https://github.com/lauriskuznecovs/next-js-jwt
Next.js and Express JWT authentication
https://github.com/lauriskuznecovs/next-js-jwt
express javascript jwt jwt-authentication mongodb nextjs nodejs npm
Last synced: 25 days ago
JSON representation
Next.js and Express JWT authentication
- Host: GitHub
- URL: https://github.com/lauriskuznecovs/next-js-jwt
- Owner: lauriskuznecovs
- License: mit
- Created: 2019-07-16T06:32:10.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-04-03T20:31:45.000Z (about 1 month ago)
- Last Synced: 2025-04-03T21:29:45.527Z (about 1 month ago)
- Topics: express, javascript, jwt, jwt-authentication, mongodb, nextjs, nodejs, npm
- Language: JavaScript
- Homepage:
- Size: 970 KB
- Stars: 147
- Watchers: 0
- Forks: 16
- Open Issues: 36
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Next.js and Express JWT authentication
## Introduction
This repo hold both - server and client apps for fully functional example of JWT authentication.
- [Server](./backend) - based on Express and MongoDB as data storage, but can be replaced to any custom data storage.
- [Client](./frontend) - based on Next.js.## Workflow
1. Run MongoDB, Server and Client.
1. Register user (described in backend directory).
2. Enter enter email/password in client app, press submit.
3. App sends request to server for user authentication.
* SUCCESS - responds with **token** which is stored in cookie.
* FAILURE - respond with particular HTTP code (no user data specified or wrong auth data provided).
4. By navigating between pages client app sends request to server with token to validation.