feat: added login to people
Created by: Nabilsenko
Test using the endpoint: POST/login
Example of JSON object { "email" : "nabil", "passwordHash" : "gGmvD.U1!" }
The returned token must be stored somewhere in the front. It must be sent in the bearer of each request (for now, only in GET/people & GET/people/{id}).
Merge request reports
Activity
Created by: hihubbIe
Review: Changes requested
-
src/people/people.controller.ts
: either replace interface by struct in @Post or declare interface in/shared
folder (seemaster
branch) -
src/config.index.ts
: don't change imports, create a localconfig.json
file and copy content of template inside.
Shouldn't calling the login endpoint return a token ?
- password should be hashed server side
- login should be a controller of its own (e.g. /auth)
- should return a token, not a person, this is done using GET on /people/:id once authentificated
- token is passed client side as the
Authorization
header, so server has to authentificate API calls with that header, and check if user's role allows them to perform action as well
-
Please register or sign in to reply