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

Implement Auth #3

Closed
michellelin1 opened this issue Nov 26, 2023 · 0 comments · Fixed by #5
Closed

Implement Auth #3

michellelin1 opened this issue Nov 26, 2023 · 0 comments · Fixed by #5
Assignees
Labels

Comments

@michellelin1
Copy link
Member

michellelin1 commented Nov 26, 2023

Instructions

  • Before you get started look at the CTC Auth Project Frontend and understand the code, as the majority of this task's code is already provided in that repo
    • If you want to clone and run the project, the .env and firebase-adminskd.json can be found in this google drive
  • Set up a route to create an account using email and password.
  • Set up a route to reset password.
  • Set up a route for email action used to verify email and reset password (refer to the EmailAction component)
  • Set up a route to log in with email and password.
  • Set up a route to log out the user.
  • For all of these functionalities, refer to the Auth Utils file and the components from the frontend.

Summarized flow

Signing Up

  • input email and password
  • get a verification email
  • verify email (link in email redirects to website)
  • show confirmation page

Logging in

  • input email and password
  • if not verified or account does not exist, show error message
  • successful login redirects to dashboard page
    • this page doesn't exist yet, so you can create a dummy page + route for /dashboard

Forgot password

  • input email
  • received email link (redirects to website)
  • input new password
  • update in FIrebase

Notes

  • Remember to add the frontend .env.
  • Creating a user in the database and anything to do with roles can be put on hold until the user routes are created.
  • Each of the pages can be minimal for now since the design is not finalized yet.
    • Simple forms with labels and inputs will do for now
  • A lot of the functions should be able to be copied and pasted from Auth Frontend, but there may be errors.

Acceptance Criteria

  • Signing up creates an account in the Firebase console. The user email should receive a verification email.
  • Can log in with an existing account. Cannot log in if the account does not exist or the user email is not verified.
    • On successful login, redirect to the /dashboard for the dashboard.
    • Store relevant information in cookies.
  • Any error shows the corresponding error on the page.
  • A successful login redirects to a "dashboard" page (this can be any temporary page for now).
    • Can sign out and doing so clears any cookies set. Redirect to login page
  • A user who tries to access any Protected Route is redirected to the login page.
  • Implement one sample Protected Route that is accessible to certain roles (ex: only super admin or admin can access).

Resources

As always, feel free to dm Michael and Michelle on Slack if you have any questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants