mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-31 19:42:15 +00:00
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:
@@ -28,6 +28,7 @@ type initUserFormData struct {
|
||||
|
||||
type initUserData struct {
|
||||
baseData
|
||||
profileData
|
||||
Code string
|
||||
UserID string
|
||||
PasswordSet bool
|
||||
@@ -73,10 +74,10 @@ func (l *Login) checkUserInitCode(w http.ResponseWriter, r *http.Request, authRe
|
||||
}
|
||||
err = l.authRepo.VerifyInitCode(setContext(r.Context(), userOrgID), data.UserID, data.Code, data.Password)
|
||||
if err != nil {
|
||||
l.renderInitUser(w, r, nil, data.UserID, "", data.PasswordSet, err)
|
||||
l.renderInitUser(w, r, authReq, data.UserID, "", data.PasswordSet, err)
|
||||
return
|
||||
}
|
||||
l.renderInitUserDone(w, r, nil)
|
||||
l.renderInitUserDone(w, r, authReq)
|
||||
}
|
||||
|
||||
func (l *Login) resendUserInit(w http.ResponseWriter, r *http.Request, authReq *model.AuthRequest, userID string, showPassword bool) {
|
||||
@@ -97,7 +98,8 @@ func (l *Login) renderInitUser(w http.ResponseWriter, r *http.Request, authReq *
|
||||
userID = authReq.UserID
|
||||
}
|
||||
data := initUserData{
|
||||
baseData: l.getBaseData(r, nil, "Init User", errType, errMessage),
|
||||
baseData: l.getBaseData(r, authReq, "Init User", errType, errMessage),
|
||||
profileData: l.getProfileData(authReq),
|
||||
UserID: userID,
|
||||
Code: code,
|
||||
PasswordSet: passwordSet,
|
||||
@@ -123,13 +125,6 @@ func (l *Login) renderInitUser(w http.ResponseWriter, r *http.Request, authReq *
|
||||
}
|
||||
|
||||
func (l *Login) renderInitUserDone(w http.ResponseWriter, r *http.Request, authReq *model.AuthRequest) {
|
||||
var loginName string
|
||||
if authReq != nil {
|
||||
loginName = authReq.LoginName
|
||||
}
|
||||
data := userData{
|
||||
baseData: l.getBaseData(r, authReq, "User Init Done", "", ""),
|
||||
LoginName: loginName,
|
||||
}
|
||||
data := l.getUserData(r, authReq, "User Init Done", "", "")
|
||||
l.renderer.RenderTemplate(w, r, l.renderer.Templates[tmplInitUserDone], data, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user