Skip to content

refactor: auth login - #91

Open
anqilique wants to merge 3 commits into
mainfrom
refactor/auth-login
Open

refactor: auth login#91
anqilique wants to merge 3 commits into
mainfrom
refactor/auth-login

Conversation

@anqilique

@anqilique anqilique commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Description

Fixed the issue with new users signing up. Previously, the required faculty was preventing signup.

Changes

  • AuthProvider.tsx refactored slightly. Clears the user when logging out, uses the loading state consistently.
  • user.ts model no longer requires university, studentID, UPI, yearOfStudy, or faculties.
  • userValidation.ts only requires faculty if the user goes some university.

@anqilique
anqilique marked this pull request as ready for review September 6, 2026 08:53

@RLee64 RLee64 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

doesn't seem to actually work?
Image

@anqilique

anqilique commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

doesn't seem to actually work?

Think I've fixed it now. Did double check the required values in userValidation.ts, but the main issue seemed to be the database indexes. Those were still checking for unique studentID and upi values, even when they were undefined/nothing. I've changed those to be sparse, but still unique (so that if people do provide studentID, it can't be the same).

Also updated the schema to reflect this, but changing the schema doesn't actually change the indexes (which had to be done manually inside Compass).

image

I was able to create several accounts now with "None" university, so that should fix the duplicate ID/upi issue. 🙏

image

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