mirror of
https://github.com/1f349/tulip.git
synced 2024-12-23 00:34:07 +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,
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user