Skip to content
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

200-Added-authorization.js-and-authentication.js-for-access-management #402

Conversation

Vikrantsingh22
Copy link
Member

Pull Request: Feature - Added Authorization Middleware

Addressed: issue #200

This pull request introduces a new feature to enhance API security using the authorization.js middleware. It is designed to determine whether a user can access a protected API route. Here are the key points:

Changes:

  1. Added authorization.js middleware.
  2. Modified existing routes to use the authorization middleware for access control.
  3. Modified the User.js model

Usage:

To utilize this feature, follow these steps:

  1. User Authentication: Users must log in and obtain a JWT access token.

  2. Access Token Placement: The access token should be included in the HTTP request headers as follows:

For Development team:

  1. Development team have to modify the .env file
  2. Inside the .env file just add a new variable STATE=Development
  3. After making this modification development team do not have to do the above steps for authorization,They will be able to access all the route as they were accessing earlier

Copy link
Member

@TejasNair9977 TejasNair9977 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@TejasNair9977 TejasNair9977 merged commit 387fc78 into development Oct 14, 2023
1 check passed
@TejasNair9977 TejasNair9977 deleted the feat-200-Added-middleware-for-authentication-and-authorization branch October 15, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants