-
Notifications
You must be signed in to change notification settings - Fork 0
Auth Endpoint
Diogo Correia edited this page Nov 25, 2020
·
2 revisions
This endpoint handles user authentication. The routes are located in the backend/src/api/auth/routes.js
file and are all prefixed by /auth
.
The route authorization is handled in the authentication middleware, located in backend/src/middleware/authentication.js
This route receives a Fenix authorization code and authorizes or denies access of the user to the app.
If denied, it returns a 401. If code
is not provided, it returns a 400.
If everything goes successfully, it returns a 200, along with user data and a JWT:
{
"user": {
"id": 1,
"name": "Diogo Torres Correia",
"istId": "ist199211",
"active": 1,
"role": "admin"
},
"jwt": "<jwt here>"
}