fix splitting layout bug - was not splitting visually original shell
This commit is contained in:
@@ -92,3 +92,24 @@ func isAuthed(r *http.Request) bool {
|
||||
c, err := r.Cookie(authCookieName)
|
||||
return err == nil && validAuthToken(c.Value)
|
||||
}
|
||||
|
||||
// refreshAuthCookie issues a fresh auth cookie, extending the session TTL
|
||||
// (sliding window). No-op in -nopw mode or if current token is already invalid.
|
||||
func refreshAuthCookie(w http.ResponseWriter, r *http.Request) {
|
||||
if nopwMode {
|
||||
return
|
||||
}
|
||||
c, err := r.Cookie(authCookieName)
|
||||
if err != nil || !validAuthToken(c.Value) {
|
||||
return
|
||||
}
|
||||
http.SetCookie(w, &http.Cookie{
|
||||
Name: authCookieName,
|
||||
Value: makeAuthToken(),
|
||||
Path: "/",
|
||||
HttpOnly: true,
|
||||
Secure: true,
|
||||
SameSite: http.SameSiteLaxMode,
|
||||
MaxAge: int(authTokenTTL.Seconds()),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user