omar-ehab / grad_auth_service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth Service

installation

1- install packages by running

$ npm install

2- copy .env.example and past it in same root folder and change the name to ".env"
3- open .env and fillup the date
4- make sure redis database is running
5- run project

$ npm run start

Student Authentication Endpoints

login endpoint

POST /auth/student/login
Parameter Type Description
email string Required.
password string Required.

Response

{
  "access_token"  : string,
  "refresh_token" : string,
  "type"          : string,
  "expiresIn"     : string
}

refresh endpoint

POST /auth/student/refresh
Parameter Type Description
refreshToken string Required.

Response

{
  "access_token"  : string,
  "refresh_token" : string,
  "type"          : string,
  "expiresIn"     : string
}

logout endpoint

POST /auth/student/logout
Header Value Description
Authorization Bearer "accessToken" Required.

Response

{
  "success"  : boolean,
  "message"  : string
}

Teacher Authentication Endpoints

login endpoint

POST /auth/teacher/login
Parameter Type Description
email string Required.
password string Required.

Response

{
  "access_token"  : string,
  "refresh_token" : string,
  "type"          : string,
  "expiresIn"     : string
}

refresh endpoint

POST /auth/teacher/refresh
Parameter Type Description
refreshToken string Required.

Response

{
  "access_token"  : string,
  "refresh_token" : string,
  "type"          : string,
  "expiresIn"     : string
}

logout endpoint

POST /auth/teacher/logout
Header Value Description
Authorization Bearer "accessToken" Required.

Response

{
  "success"  : boolean,
  "message"  : string
}

About


Languages

Language:JavaScript 98.9%Language:Shell 1.1%