diff --git a/server/login.go b/server/login.go index fe33b5c..1251949 100644 --- a/server/login.go +++ b/server/login.go @@ -126,6 +126,10 @@ func (h *HttpServer) LoginPost(rw http.ResponseWriter, req *http.Request, _ http NeedOtp: hasOtp, } + if h.setLoginDataCookie(rw, auth) { + return + } + if hasOtp { originUrl, err := url.Parse(req.FormValue("redirect")) if err != nil { @@ -137,9 +141,6 @@ func (h *HttpServer) LoginPost(rw http.ResponseWriter, req *http.Request, _ http return } - if h.setLoginDataCookie(rw, auth) { - return - } h.SafeRedirect(rw, req) }