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:
Fabi
2020-07-22 11:43:32 +02:00
committed by GitHub
parent 520cc161d7
commit f39d3a3cc7
29 changed files with 195 additions and 86 deletions
@@ -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 {
+3
View File
@@ -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)
},
+1
View File
@@ -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)