bbmcmann / 307MovieProject

3 stars 1 forks source link

Login signup backend and protected endpoints #65

Closed jlaksana closed 1 year ago

jlaksana commented 1 year ago

Implemented the login and signup routes using JWT and bcrypt. Login validates the user's username and password and responds with a token. Signup takes in all the user required fields, creates a user with those fields, and responds with a token. The token contains the user's id and username. I also implemented the middleware function to validate a token and applied it to all post and patch routes.

Routes added:

To test the login route, use these users: {"username": "JoeMama", "password": "ilovebananas"} {"username": "joebaba", "password": "iloveoranges"}

then use the token, add it to the header, then call one of the protected routes.

For protected routes, add to the request header: Authorization: Bearer {token}

Other notes:

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-glacier-0bbe79d1e-65.westus2.2.azurestaticapps.net

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-glacier-0bbe79d1e-65.westus2.2.azurestaticapps.net

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-glacier-0bbe79d1e-65.westus2.2.azurestaticapps.net

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-glacier-0bbe79d1e-65.westus2.2.azurestaticapps.net

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-glacier-0bbe79d1e-65.westus2.2.azurestaticapps.net

github-actions[bot] commented 1 year ago

Azure Static Web Apps: Your stage site is ready! Visit it here: https://white-glacier-0bbe79d1e-65.westus2.2.azurestaticapps.net