Skip to content

Commit

Permalink
feat: make conditional ui available via env var in quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
like-a-bause authored and bjoern-m committed Mar 14, 2023
1 parent 4f39d76 commit fdf1099
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions quickstart/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ func main() {
hankoUrlInternal = value
}

_, conditionalUi := os.LookupEnv("HANKO_ENABLE_CONDITIONAL_UI")

e := echo.New()
e.Renderer = t

Expand All @@ -42,6 +44,7 @@ func main() {
indexData := IndexData{
HankoUrl: hankoUrl,
HankoElementUrl: hankoElementUrl,
ConditionalUi: conditionalUi,
}
return c.Render(http.StatusOK, "index.html", &indexData)
})
Expand All @@ -65,6 +68,7 @@ func main() {
type IndexData struct {
HankoUrl string
HankoElementUrl string
ConditionalUi bool
}

type Template struct {
Expand Down
2 changes: 1 addition & 1 deletion quickstart/public/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<main class="main">
<div class="auth-container">
<hanko-auth lang="en" api="{{.HankoUrl}}"></hanko-auth>
<hanko-auth lang="en" api="{{.HankoUrl}}" {{if .ConditionalUi}}experimental="conditionalMediation"{{end}}></hanko-auth>
</div>
</main>

Expand Down

0 comments on commit fdf1099

Please sign in to comment.