Skip to content

Frontend account activation#36

Merged
mraysu merged 26 commits intomainfrom
frontend-account-activation
Mar 12, 2026
Merged

Frontend account activation#36
mraysu merged 26 commits intomainfrom
frontend-account-activation

Conversation

@OrigamiStarz
Copy link
Contributor

@OrigamiStarz OrigamiStarz commented Mar 2, 2026

Tracking Info

Resolves #6

Changes

  • Made 3 new pages/routes: /activate, /login, /forgot-password
    • Note that /activate and /forgot-password functionality is implemented through firebase instead of through those pages, but the UI is done
  • Added logout button + functionality in the nav bar
  • Setup firebase auth in frontend + enforce it for restricted pages
  • Developed functionality in the frontend for creating users and resetting passwords
  • Created a script that can manually create an admin user for testing purposes

Testing

  • Local testing
    • Using a script to create an admin account
    • Using the new modal to make new accounts
    • Ensuring that the user is unable to access restricted pages unless logged in
      • Including after being logged out

Confirmation of Change

Add Staff Modal:
Screenshot 2026-03-01 at 9 42 55 PM
Screenshot 2026-03-01 at 9 43 37 PM

Password Reset:
Screenshot 2026-03-01 at 9 44 42 PM
Screenshot 2026-03-01 at 9 44 51 PM

@mraysu
Copy link
Collaborator

mraysu commented Mar 2, 2026

please remove package.json and package-lock.json from the root directory (NOT frontend/package.json) and try running the deployment job again

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Visit the preview URL for this PR (updated for commit d00e477):

https://meemli-dev--pr36-frontend-account-act-e8oxglf1.web.app

(expires Thu, 19 Mar 2026 07:28:01 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 633a893569aee98f762f025e27aa080a469727e1

@mraysu mraysu requested a review from LubabDesu March 3, 2026 01:18
Copy link
Collaborator

@mraysu mraysu left a comment

Choose a reason for hiding this comment

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

Great work on the login functionality.

For this PR, phoneNumber and assignedSections should have added backend functionality. Right now, both fields are being dropped when sending create user routes.

Update the database schema to include both fields, and make sure when assigning sections to update both the User and Section objects

Copy link
Collaborator

Choose a reason for hiding this comment

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

In the future, should convert the login component to a <form> so we can submit on enter, for a more intuitive login

const [addOpen, setAddOpen] = useState(false);

return (
<Page>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unsure about the need for this <Page> component, since the styling in Page.module.css is empty

@Himir-Desai
Copy link
Contributor

image Will have to fix this bug

Copy link
Collaborator

@mraysu mraysu left a comment

Choose a reason for hiding this comment

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

Still a few issues, we need to make sure that when teachers are assigned to classes, the section objects also update with teacher assignment. Right now it is only updating the User object

Also, can you add an error message on invalid login

@Himir-Desai
Copy link
Contributor

When teachers are assigned to classes the section objects does update with the teacher id in the teachers field
image
The above is responsible for it. Below is a test

image

Before
image

After
image

User
image

@Himir-Desai
Copy link
Contributor

Also added error message for invalid login credentials

@mraysu
Copy link
Collaborator

mraysu commented Mar 10, 2026

my fault, was looking in the backend controller. should be gtg

Copy link
Collaborator

@mraysu mraysu left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@LubabDesu
Copy link
Contributor

I think overall functionality and everything works fine, just one thing that I noticed was this :

image

On the forgot password page, when I enter an invalid email, I think a more descriptive error message (which was intended as I see in the code) should be displayed, but it isn't being displayed.

I think the error is here : if (
email &&
!email.includes("@") &&
!email.includes(".") &&
email.indexOf("@") < email.indexOf(".")
) {
setFormErrors({ email: "Please enter a valid email address" });
return;
} -- the && chains eventually lead to alot of cases slipping through

Other than that it seems good to me

Copy link
Contributor

@LubabDesu LubabDesu left a comment

Choose a reason for hiding this comment

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

LGTM!

@mraysu mraysu merged commit fce1b2b into main Mar 12, 2026
4 checks passed
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.

Frontend Login, Create User, Account Activation

4 participants