Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Author authentication #56

Merged
merged 12 commits into from
Oct 23, 2023
Merged

Author authentication #56

merged 12 commits into from
Oct 23, 2023

Conversation

nluu175
Copy link
Contributor

@nluu175 nluu175 commented Oct 23, 2023

Change Lists:

  • Implemented endpoints to server login and signup purpose
  • Updated Author model by adding user field for authentication
  • Added Login and SignUp components on frontend side
  • Added react-toastify library for displaying toast message

Todo:

  • Implement the logic to restrict certains routes when not logged in

Guide on testing:

  • Please run migrate and make migrations on server before you run the server since there are changes to the database.

  • For testing only the 2 new endpoints (using Postman)

  • signup: Currently returns status code 200 on succesful sign up, 409 on existing username and 400 on others.
    Screenshot 2023-10-23 at 12 09 36 AM
  • login: Currently returns status code 201 on succesful login, 401 on wrong password and 404 on not existing username.
    Screenshot 2023-10-23 at 12 12 23 AM
  • For testing on the frontend side
  • at /signup/, there are currently 5 fields. Any errors will have a toast message pop up. Succesful display a success message and redirect to /login/
  • at /login/, there are currently 2 fields. Any errors will have a toast message pop up. Succesful display a success message and redirect to /home-page/ and save authToken to localStorage (localStorage can be found in develop tools).

Copy link
Contributor

@Boredalien248 Boredalien248 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nluu175
Copy link
Contributor Author

nluu175 commented Oct 23, 2023

Looks good to me.

@Boredalien248 hey have you tried pulling the branch and testing the new features? Please run npm start on the client and check the /login and /signup if they work correctly. I tested it on mine but I'd love to have someone else on check on on environment as well. Thank you!!!

Copy link
Contributor

@Boredalien248 Boredalien248 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nluu175 Sorry about the oversight

  • merge conflicts

Copy link
Contributor

@Boredalien248 Boredalien248 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything seems to be working fine.
password checking and username checking seem to be working perfectly.
everything seems to be added perfectly in the db.

@nluu175 nluu175 merged commit 2de8514 into main Oct 23, 2023
1 check passed
@nluu175 nluu175 deleted the author-authentication branch October 23, 2023 06:41
@nluu175 nluu175 restored the author-authentication branch October 24, 2023 21:33
@nluu175 nluu175 deleted the author-authentication branch October 24, 2023 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants