mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix: only show external login text when providers available (#768)
This commit is contained in:
parent
da8f243129
commit
9887e897ee
@ -31,7 +31,10 @@ func NewRenderer(dir http.FileSystem, tmplMapping map[string]string, funcs map[s
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
r.loadTemplates(dir, tmplMapping, funcs)
|
||||
err = r.loadTemplates(dir, tmplMapping, funcs)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
|
||||
|
@ -68,5 +68,10 @@ func (l *Login) renderLogin(w http.ResponseWriter, r *http.Request, authReq *mod
|
||||
errMessage = l.getErrorMessage(r, err)
|
||||
}
|
||||
data := l.getUserData(r, authReq, "Login", errType, errMessage)
|
||||
l.renderer.RenderTemplate(w, r, l.renderer.Templates[tmplLogin], data, nil)
|
||||
funcs := map[string]interface{}{
|
||||
"hasExternalLogin": func() bool {
|
||||
return authReq.LoginPolicy.AllowExternalIDP && authReq.AllowedExternalIDPs != nil && len(authReq.AllowedExternalIDPs) > 0
|
||||
},
|
||||
}
|
||||
l.renderer.RenderTemplate(w, r, l.renderer.Templates[tmplLogin], data, funcs)
|
||||
}
|
||||
|
@ -137,6 +137,9 @@ func CreateRenderer(pathPrefix string, staticDir http.FileSystem, cookieName str
|
||||
"selectedGender": func(g int32) bool {
|
||||
return false
|
||||
},
|
||||
"hasExternalLogin": func() bool {
|
||||
return false
|
||||
},
|
||||
}
|
||||
var err error
|
||||
r.Renderer, err = renderer.NewRenderer(
|
||||
|
@ -36,7 +36,7 @@
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if .LoginPolicy.AllowExternalIDP}}
|
||||
{{if hasExternalLogin }}
|
||||
<div class="actions idp-providers">
|
||||
<p>{{t "Login.ExternalLogin"}}</p>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user