CS3219-AY2324S1 / ay2324s1-course-assessment-g05

A collaborative technical interview preparation platform that is going to boost your interview performance!
MIT License
0 stars 3 forks source link

Fix auth service issues and UI changes to forgotpassword and login #118

Closed xingjie99 closed 1 year ago

xingjie99 commented 1 year ago

Pull Request

Description

Fixes some of the problem as mentioned by Rui Yang in issue 116.

Related Issue(s)

Closes #116

Changes Made

  1. Added back to login link in forgot password image
  2. Reformat reset password email message image
  3. Generalise login failed message image
  4. Handle Auth Service failure in frontend and backend
  5. Add Auth service to npm run setup-all and remove unnecessary packages that might have been accidentally installed... sorry....
  6. Impose stricter email validation on frontend to match backend validator: image

Screenshots (if applicable)

Note that the Error toast on the bottom left is because this /error page actually intentionally throws an Error, and this will not be seen in production. I have created app/error.tsx, which will be used as the default component to be rendered when uncaught errors are thrown in NextJs in order to handle them gracefully (see doc). However, since we are trying to handle an error that occurs in the middleware, which is run before any rendering occurs, this fallback does not apply automatically to this situation, which is why I had to create another route /error just for this. Note that this /error page should NOT be routed to in any other case!!

As for why I did not just render the error component in the error page itself, it is because I thought it would be nice/useful to just create the fallback error.tsx, since it could be useful in handling any other uncaught errors throughout our frontend. This is the most graceful way I can think of for now... Let me know if you guys have any concerns about this implementation....

Checklist

Additional Notes/References

tryyang2001 commented 1 year ago

Do we have any progress left for this PR? If not please try to resolve the merge conflicts and merge to master.