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:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user