bugfix: Cookie expiry for OAuth2 & Local set to 1 year, not session (#451)
This commit is contained in:
parent
80e5b5b0c1
commit
be9b2a7c78
|
|
@ -41,8 +41,11 @@ func forwardResponseHandlerLoginLocalUser(md metadata.MD, w http.ResponseWriter)
|
||||||
http.SetCookie(
|
http.SetCookie(
|
||||||
w,
|
w,
|
||||||
&http.Cookie{
|
&http.Cookie{
|
||||||
Name: "olivetin-sid-local",
|
Name: "olivetin-sid-local",
|
||||||
Value: sid,
|
Value: sid,
|
||||||
|
MaxAge: 31556952, // 1 year
|
||||||
|
HttpOnly: true,
|
||||||
|
Path: "/",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ func setOauthCallbackCookie(w http.ResponseWriter, r *http.Request, name, value
|
||||||
cookie := &http.Cookie{
|
cookie := &http.Cookie{
|
||||||
Name: name,
|
Name: name,
|
||||||
Value: value,
|
Value: value,
|
||||||
MaxAge: int(time.Hour.Seconds()),
|
MaxAge: 31556952, // 1 year
|
||||||
Secure: r.TLS != nil,
|
Secure: r.TLS != nil,
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
Path: "/",
|
Path: "/",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue