mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-14 01:45:12 +00:00
fix: login flow handling (#491)
* fix: login flow handling * fix: cancel button * fix: hover in light design * fix: profile image width * fix: profile image width * fix: profile image width
This commit is contained in:
@@ -37,6 +37,17 @@ func (l *Login) handleMfaPrompt(w http.ResponseWriter, r *http.Request) {
|
||||
l.handleLogin(w, r)
|
||||
}
|
||||
|
||||
func (l *Login) handleMfaPromptSelection(w http.ResponseWriter, r *http.Request) {
|
||||
data := new(mfaPromptData)
|
||||
authReq, err := l.getAuthRequestAndParseData(r, data)
|
||||
if err != nil {
|
||||
l.renderError(w, r, authReq, err)
|
||||
return
|
||||
}
|
||||
|
||||
l.renderNextStep(w, r, authReq)
|
||||
}
|
||||
|
||||
func (l *Login) renderMfaPrompt(w http.ResponseWriter, r *http.Request, authReq *model.AuthRequest, mfaPromptData *model.MfaPromptStep, err error) {
|
||||
var errType, errMessage string
|
||||
if err != nil {
|
||||
|
||||
@@ -87,6 +87,9 @@ func CreateRenderer(pathPrefix string, staticDir http.FileSystem, cookieName str
|
||||
"mfaPromptUrl": func() string {
|
||||
return path.Join(r.pathPrefix, EndpointMfaPrompt)
|
||||
},
|
||||
"mfaPromptChangeUrl": func(id string, provider model.MfaType) string {
|
||||
return path.Join(r.pathPrefix, fmt.Sprintf("%s?%s=%s;%s=%v", EndpointMfaPrompt, queryAuthRequestID, id, "provider", provider))
|
||||
},
|
||||
"mfaInitVerifyUrl": func() string {
|
||||
return path.Join(r.pathPrefix, EndpointMfaInitVerify)
|
||||
},
|
||||
|
||||
@@ -46,6 +46,7 @@ func CreateRouter(login *Login, staticDir http.FileSystem, interceptors ...mux.M
|
||||
router.HandleFunc(EndpointInitUser, login.handleInitUser).Methods(http.MethodGet)
|
||||
router.HandleFunc(EndpointInitUser, login.handleInitUserCheck).Methods(http.MethodPost)
|
||||
router.HandleFunc(EndpointMfaVerify, login.handleMfaVerify).Methods(http.MethodPost)
|
||||
router.HandleFunc(EndpointMfaPrompt, login.handleMfaPromptSelection).Methods(http.MethodGet)
|
||||
router.HandleFunc(EndpointMfaPrompt, login.handleMfaPrompt).Methods(http.MethodPost)
|
||||
router.HandleFunc(EndpointMfaInitVerify, login.handleMfaInitVerify).Methods(http.MethodPost)
|
||||
router.HandleFunc(EndpointMailVerification, login.handleMailVerification).Methods(http.MethodGet)
|
||||
|
||||
Reference in New Issue
Block a user