DayInReview / day-in-review

Full Day In Review application
http://dayinreview.org
Apache License 2.0
2 stars 0 forks source link

User Authentication API #21

Closed JimothyGreene closed 3 years ago

JimothyGreene commented 3 years ago

Problem:

We have no user authentication system, so every session of the website looks identical regardless of who is using it. Also, this means that every page is accessible to every user, not just registered users.

Solution:

Implement user authentication using JWT (JSON Web Token) and Passport (session-based user authentication that stores information in the browser localstorage). Expose API endpoints for user login and registration that can be called from the frontend.

Testing:

The API endpoints were tested using Postman, a tool that can send HTTP requests with specified payloads and displays the response payload. The cloud database was also checked to ensure that the data was sent properly to the MongoDB instance. Additionally, subsequent registration and login were tested to ensure that once a user registers, they are able to login and receive an authentication token for use throughout the site.

Notes:

Closes #12