/refresh_token_express_typescript

Implementation of access refresh token authentication on Express and NodeJS with Typescript

Primary LanguageTypeScript

Prerequisites

Getting started

1- Install dependencies by running the following command on your terminal

npm i

2- Start your dev server by running:

npm run dev

Notes

In order to compile typescript code, and generate the javascript code, you need to run this command:

npm run build

After building the project, you can start the project by either running this command:

npm start

Endpoints

GET http://0.0.0.0:3003/auth/
POST http://0.0.0.0:3003/auth/login
with the folowing body (deatils are on the dao):

{
    "username": "user2@email.com",
    "password": "password123-2"
}

GET http://0.0.0.0:3003/auth/current-user
with the folowing authaurisation on headers: Bearer accessToken
POST http://0.0.0.0:3003/auth/refresh

{
    "refreshToken": {{refreshToken}}
}