Skip to content

The server for study about authentication on Next.JS using Next Auth. Built using Node.js, Express, JWT and Typescript.

Notifications You must be signed in to change notification settings

areasflavio/next-auth-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

next-auth-server

The server for study about authentication on Next.JS using Next Auth. Built using Node.js, Express, JWT and Typescript.

GitHub top language GitHub language count GitHub last commit

Features  |   API Reference  |   Technologies  |   Installation

⭐ Features

(Back to top)

This is a server API for study about authentication on Next.JS using Next Auth. The data are all static just for tests purpose.

Some key features are:

  • Token and Refresh Token strategy using JWT.
  • Roles and Permissions as auth types.

The application is built using Node.JS with Express framework. The data is not stored. The entire codebase is written using Typescript.

The frontend can be found in this repo

Project developed at Chapter IV of Rocketseat's Ignite bootcamp.


💻 API-Reference

(Back to top)

Login with a user

  POST /session
Body Type Description
email string Required. Email of the user
password string Required. Password of the user

All next routes need authentication!


Refresh current user token

  POST /refresh
Body Type Description
refreshToken string Required. Refresh token of the user

Get current user info

  GET /me

⌨️ Technologies

(Back to top)

This is what i used and learned with this project:

  • Node.JS
  • Express
  • JWT
  • UUID
  • Typescript

🖱️ Installation

(Back to top)

To use this project, first you need NodeJS running in your device, then you can follow the commands below:

# Clone this repository
git clone https://github.com/areasflavio/next-auth-server.git

# Go into the repository
cd next-auth-server

# Install dependencies for the backend
yarn install

# To start the express development server, run the following command
yarn dev

👨‍💻 Author

(Back to top)

Build by Flávio Arêas 👋 Get in touch!

About

The server for study about authentication on Next.JS using Next Auth. Built using Node.js, Express, JWT and Typescript.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published