PLT-6492 Use new cookie to determine if user is logged in (#6317)
* Use new cookie to determine if user is logged in * Add temporary code for 3.9 to prevent forced re-login
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1838f6c25e
Коммит
fe95276ba8
10
app/login.go
10
app/login.go
@@ -122,7 +122,17 @@ func DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId
|
||||
Secure: secure,
|
||||
}
|
||||
|
||||
userCookie := &http.Cookie{
|
||||
Name: model.SESSION_COOKIE_USER,
|
||||
Value: user.Id,
|
||||
Path: "/",
|
||||
MaxAge: maxAge,
|
||||
Expires: expiresAt,
|
||||
Secure: secure,
|
||||
}
|
||||
|
||||
http.SetCookie(w, sessionCookie)
|
||||
http.SetCookie(w, userCookie)
|
||||
|
||||
return session, nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user