anand-harsh / Edumi

Edumi, Place to learn and grow skills with proper maintenance
https://edumi.vercel.app/
9 stars 29 forks source link

Feature Request: refreshToken in JWT Authentication #121

Closed JavidSumra closed 4 months ago

JavidSumra commented 4 months ago

Guidelines

Description

Description: Currently, our application relies on JSON Web Tokens (JWT) for authentication. However, we've encountered limitations with the expiration of JWT tokens. To address this, we propose implementing a refreshToken mechanism alongside JWT authentication.

Problem

Motivation:

  1. Enhanced Security: Refresh tokens provide an additional layer of security by allowing short-lived JWT tokens to be refreshed without requiring users to log in again.
  2. Improved User Experience: With refreshToken support, users won't be abruptly logged out due to expired JWT tokens, enhancing their overall experience.
  3. Scalability: Implementing refreshToken can facilitate scalability by reducing the need for frequent re-authentication requests, especially in high-traffic scenarios.

Proposed Solution

Proposed Solution: Introduce a refreshToken endpoint that, upon receiving a valid refresh token, issues a new JWT token without requiring users to provide their credentials again. This endpoint should handle token expiration, invalidation, and rotation securely.

Additional Considerations:

Implementation Details:

  1. Backend Changes: Describe the necessary changes to the backend infrastructure, including modifications to the authentication service and database schema.
  2. API Endpoints: Specify the endpoints required for refreshToken functionality, along with their expected behavior and input/output formats.
  3. Documentation: Update relevant documentation, including API documentation and developer guides, to reflect the addition of refreshToken support.

Alternatives Considered:

Impact and Benefits:

Alternatives Considered

No Alternative Solution

JavidSumra commented 4 months ago

Hey @anand-harsh Sir Please Assign me This issue Under JWOC 2024