fix splitting layout bug - was not splitting visually original shell

This commit is contained in:
2026-05-24 09:09:03 +00:00
parent 3ab54f812a
commit ade413bac7
10 changed files with 151 additions and 1 deletions
+21
View File
@@ -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()),
})
}