feat(auth): extend session duration to 7 days using constants

- Add SessionDuration constant (7 days) and SessionDurationSec computed value
- Update JWT token expiration to use SessionDuration instead of 1 hour
- Update register/login cookie MaxAge to use SessionDurationSec (604800)
- Update register/login API response ExpiresIn to use SessionDurationSec
- Update refresh token endpoint ExpiresIn to use SessionDurationSec
- Remove redundant client-side document.cookie lines from login/register
- Add TODO comment for HTTPS cookie Secure flag

This provides Google-like persistent sessions with a single source of truth
for session duration, eliminating hardcoded values throughout the codebase.
This commit is contained in:
2026-02-16 16:49:43 -05:00
parent c9ebc5b11a
commit 2e1af8d20b
2 changed files with 20 additions and 12 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ func (h *AuthHandler) RefreshAccessToken(c echo.Context) error {
return c.JSON(http.StatusOK, RefreshTokenResponse{
AccessToken: accessToken,
TokenType: "Bearer",
ExpiresIn: 3600,
ExpiresIn: SessionDurationSec,
})
}