Move setLoginDataCookie before redirecting to /login/otp

This commit is contained in:
Melon 2024-02-13 18:14:52 +00:00
parent b6d5bef56c
commit 7cd49fce0d
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -126,6 +126,10 @@ func (h *HttpServer) LoginPost(rw http.ResponseWriter, req *http.Request, _ http
NeedOtp: hasOtp, NeedOtp: hasOtp,
} }
if h.setLoginDataCookie(rw, auth) {
return
}
if hasOtp { if hasOtp {
originUrl, err := url.Parse(req.FormValue("redirect")) originUrl, err := url.Parse(req.FormValue("redirect"))
if err != nil { if err != nil {
@ -137,9 +141,6 @@ func (h *HttpServer) LoginPost(rw http.ResponseWriter, req *http.Request, _ http
return return
} }
if h.setLoginDataCookie(rw, auth) {
return
}
h.SafeRedirect(rw, req) h.SafeRedirect(rw, req)
} }