mirror of
https://github.com/1f349/tulip.git
synced 2024-11-09 22:42:53 +00:00
Move setLoginDataCookie before redirecting to /login/otp
This commit is contained in:
parent
b6d5bef56c
commit
7cd49fce0d
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user