mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-04-05 15:36:15 +00:00
feat(security): add session cookie management functions
* Introduce SessionCookieOptions for configurable session cookies * Implement SetSessionCookie, GetSessionCookie, and ClearSessionCookie functions * Enhance cookie handling in DatabaseAuthenticator
This commit is contained in:
@@ -222,9 +222,8 @@ func (a *DatabaseAuthenticator) Authenticate(r *http.Request) (*UserContext, err
|
||||
|
||||
if sessionToken == "" {
|
||||
// Try cookie
|
||||
cookie, err := r.Cookie("session_token")
|
||||
if err == nil {
|
||||
tokens = []string{cookie.Value}
|
||||
if token := GetSessionCookie(r); token != "" {
|
||||
tokens = []string{token}
|
||||
reference = "cookie"
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user