mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-09 23:55:12 +00:00
fix(login): custom texts for pages called directly form mail link (#4415)
* fix(login): translate init password correctly * refactor: no error return params * fix(login): custom texts for pages called directly form mail link * fix custom text on registration pages Co-authored-by: adlerhurst <[email protected]>
This commit is contained in:
co-authored by
adlerhurst
parent
fc4f4096e0
commit
05cb672cff
@@ -30,15 +30,14 @@ type registerFormData struct {
|
||||
type registerData struct {
|
||||
baseData
|
||||
registerFormData
|
||||
PasswordPolicyDescription string
|
||||
MinLength uint64
|
||||
HasUppercase string
|
||||
HasLowercase string
|
||||
HasNumber string
|
||||
HasSymbol string
|
||||
ShowUsername bool
|
||||
ShowUsernameSuffix bool
|
||||
OrgRegister bool
|
||||
MinLength uint64
|
||||
HasUppercase string
|
||||
HasLowercase string
|
||||
HasNumber string
|
||||
HasSymbol string
|
||||
ShowUsername bool
|
||||
ShowUsernameSuffix bool
|
||||
OrgRegister bool
|
||||
}
|
||||
|
||||
func (l *Login) handleRegister(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -124,9 +123,8 @@ func (l *Login) renderRegister(w http.ResponseWriter, r *http.Request, authReque
|
||||
registerFormData: *formData,
|
||||
}
|
||||
|
||||
pwPolicy, description, _ := l.getPasswordComplexityPolicy(r, authRequest, resourceOwner)
|
||||
pwPolicy := l.getPasswordComplexityPolicy(r, resourceOwner)
|
||||
if pwPolicy != nil {
|
||||
data.PasswordPolicyDescription = description
|
||||
data.MinLength = pwPolicy.MinLength
|
||||
if pwPolicy.HasUppercase {
|
||||
data.HasUppercase = UpperCaseRegex
|
||||
@@ -171,6 +169,9 @@ func (l *Login) renderRegister(w http.ResponseWriter, r *http.Request, authReque
|
||||
return formData.Gender == g
|
||||
},
|
||||
}
|
||||
if authRequest == nil {
|
||||
l.customTexts(r.Context(), translator, resourceOwner)
|
||||
}
|
||||
l.renderer.RenderTemplate(w, r, translator, l.renderer.Templates[tmplRegister], data, funcs)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user