You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add refresh token endpoint and related configurations (#9)
* feat: add refresh token endpoint and related configurations
New Feature:
-Implemented the RefreshToken method in the TokenUsecase to handle token refreshing.
-The method retrieves the refresh token from the HTTP cookie, validates it, and generates a new access and refresh token pair.
Details:
-Extracts the refresh token from the cookie using c.Cookie.
-Validates the refresh token and extracts claims using the GetClaims method.
-Converts roles from []interface{} to []string for proper type handling.
-Generates a new token pair using the GenerateToken method.
Reason for Addition:
-To provide functionality for refreshing expired access tokens while maintaining security through refresh tokens.
-This is a critical feature for session management in the application.
Benefits:
-Enables secure token lifecycle management.
-Improves user experience by allowing seamless token refresh without requiring re-login.
* Fix refresh token method, set CSRF SameSite, and minor domain config correction
- change refresh token request method from GET to POST for better security and API alignment.
- Added 'SameSite' attribute to CSRF cookie in production for improved security.
- Corrected a minor typo in domain config (added missing 'a' in "domain")
* feat: add token usecase and config to UsersHandler
---------
Co-authored-by: Hamed Naeemaei <[email protected]>
0 commit comments