feat(login): show profile (#485)

* profile data

* fix scripts

* fix image paths

* feat: show profile (with image) when possible

* fix profile image width
This commit is contained in:
Livio Amstutz
2020-07-20 10:00:29 +02:00
committed by GitHub
parent 4f3ccbfad0
commit 933193855a
42 changed files with 321 additions and 212 deletions

View File

@@ -25,6 +25,7 @@ type initPasswordFormData struct {
type initPasswordData struct {
baseData
profileData
Code string
UserID string
PasswordPolicyDescription string
@@ -93,9 +94,10 @@ func (l *Login) renderInitPassword(w http.ResponseWriter, r *http.Request, authR
}
data := initPasswordData{
baseData: l.getBaseData(r, authReq, "Init Password", errType, errMessage),
UserID: userID,
Code: code,
baseData: l.getBaseData(r, authReq, "Init Password", errType, errMessage),
profileData: l.getProfileData(authReq),
UserID: userID,
Code: code,
}
policy, description, _ := l.getPasswordComplexityPolicyByUserID(r, userID)
if policy != nil {
@@ -118,13 +120,6 @@ func (l *Login) renderInitPassword(w http.ResponseWriter, r *http.Request, authR
}
func (l *Login) renderInitPasswordDone(w http.ResponseWriter, r *http.Request, authReq *model.AuthRequest) {
loginName := ""
if authReq != nil {
loginName = authReq.LoginName
}
data := userData{
baseData: l.getBaseData(r, authReq, "Password Init Done", "", ""),
LoginName: loginName,
}
data := l.getUserData(r, authReq, "Password Init Done", "", "")
l.renderer.RenderTemplate(w, r, l.renderer.Templates[tmplInitPasswordDone], data, nil)
}