bugfix: Cookie expiry for OAuth2 & Local set to 1 year, not session (#451)

This commit is contained in:
James Read 2024-10-20 22:58:12 +01:00 committed by GitHub
parent 80e5b5b0c1
commit be9b2a7c78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -43,6 +43,9 @@ func forwardResponseHandlerLoginLocalUser(md metadata.MD, w http.ResponseWriter)
&http.Cookie{
Name: "olivetin-sid-local",
Value: sid,
MaxAge: 31556952, // 1 year
HttpOnly: true,
Path: "/",
},
)
}

View File

@ -96,7 +96,7 @@ func setOauthCallbackCookie(w http.ResponseWriter, r *http.Request, name, value
cookie := &http.Cookie{
Name: name,
Value: value,
MaxAge: int(time.Hour.Seconds()),
MaxAge: 31556952, // 1 year
Secure: r.TLS != nil,
HttpOnly: true,
Path: "/",