Open Phastboy opened 2 weeks ago
Enable users to refresh their session without needing to log in again by providing a refresh token that can generate a new JWT.
refreshToken
apps/auth
apps/buddy
Enable users to refresh their session without needing to log in again by providing a refresh token that can generate a new JWT.
Tasks:
Step 1: Add a Refresh Token Field to User Model
refreshToken
in the user model (MongoDB) to track active refresh tokens if needed.Step 2: Generate Refresh Tokens in
apps/auth
Step 3: Create an Endpoint to Exchange Refresh Tokens
apps/auth
to handle requests for refreshing the JWT.Step 4: Set the Refresh Token in
apps/buddy
apps/buddy
to securely store the refresh token in an HttpOnly cookie or part of the response.Step 5: Test the Refresh Token Flow
Acceptance Criteria: