Skip to content

feat: add refresh token endpoint and related configurations #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alielmi98
Copy link

@alielmi98 alielmi98 commented Mar 21, 2025

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.

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.
@naeemaei naeemaei assigned naeemaei and unassigned naeemaei Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants