-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from Pulkit95700/jwt-authentication-backend
Jwt authentication backend
- Loading branch information
Showing
24 changed files
with
1,950 additions
and
2 deletions.
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
Node-JS-Projects/Intermediate/JWT-Authenticator-With-Roles/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<h1 align='center'><b>💥 JWT-Authenticator-With-Roles 💥</b></h1> | ||
|
||
<div align='center' style='display: flex; justify-content: center; gap: 1rem'> | ||
|
||
 | ||
|
||
 | ||
|
||
 | ||
|
||
 | ||
|
||
</div> | ||
|
||
 | ||
|
||
|
||
## Description 📃 | ||
|
||
<div> | ||
<p>This api helps user to get a modern starting project for production use. This is a standard setup for any production level project. The different files are used to handle different functions. You can clone it to get started on your project quickly. | ||
|
||
This readme file provides all the details you need to run and use this project.</p> | ||
</div> | ||
|
||
|
||
## How to run it? 🕹️ | ||
|
||
- Clone the repository | ||
- Run `npm install` | ||
- Create a `.env` file and add the following variables | ||
- `PORT` | ||
- `ACCESS_TOKEN_SECRET` | ||
- `REFRESH_TOKEN_SECRET` | ||
- `ACCESS_TOKEN_EXPIRY` | ||
- `REFRESH_TOKEN_EXPIRY` | ||
- `BCRYPT_SALT` | ||
- `MONGODB_URI` | ||
- `CORS_ORIGIN` | ||
- Run `npm run dev` or `npm start` | ||
|
||
|
||
|
||
## Features | ||
|
||
- **User Authentication** | ||
|
||
- Register | ||
- Login | ||
- Logout | ||
- Refresh Token | ||
|
||
- **User Roles** | ||
- Admin | ||
- User | ||
|
||
## Screenshots of Endpoints | ||
|
||
**POST `api/v1/user/register`** | ||
|
||
 | ||
|
||
**POST `api/v1/user/register-admin`** | ||
|
||
 | ||
|
||
**POST `api/v1/user/login`** | ||
|
||
 | ||
|
||
**POST `api/v1/user/logout`** | ||
|
||
 | ||
|
||
**POST `api/v1/user/refresh-token`** | ||
|
||
 | ||
|
||
**GET `api/v1/user/i-am-user`** | ||
|
||
 | ||
|
||
**GET `api/v1/user/i-am-admin`** | ||
|
||
 | ||
|
||
 | ||
|
||
<h4 align='center'>Developed By <b><i>PULKIT GUPTA</i></b> 👦</h4> | ||
<p align='center'> | ||
<a href='https://www.linkedin.com/in/pulkit-gupta-b16a721ba'> | ||
<img src='https://img.shields.io/badge/linkedin-%230077B5.svg?style=for-the-badge&logo=linkedin&logoColor=white' /> | ||
</a> | ||
<a href='https://github.com/Pulkit95700'> | ||
<img src='https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white' /> | ||
</a> | ||
</p> | ||
|
||
<h4 align='center'>Happy Coding 🧑💻</h4> | ||
|
||
<h3 align="center">Show some ❤️ by 🌟 this repository!</h3> |
Binary file added
BIN
+103 KB
Node-JS-Projects/Intermediate/JWT-Authenticator-With-Roles/images/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+103 KB
Node-JS-Projects/Intermediate/JWT-Authenticator-With-Roles/images/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+94 KB
Node-JS-Projects/Intermediate/JWT-Authenticator-With-Roles/images/logout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+102 KB
...-JS-Projects/Intermediate/JWT-Authenticator-With-Roles/images/protectedUser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+94.1 KB
...S-Projects/Intermediate/JWT-Authenticator-With-Roles/images/protected_admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+101 KB
Node-JS-Projects/Intermediate/JWT-Authenticator-With-Roles/images/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+105 KB
...JS-Projects/Intermediate/JWT-Authenticator-With-Roles/images/register_admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.