Skip to content

Feat/user register crash#87

Open
Sakina-786-vi wants to merge 2 commits into
avishek0769:mainfrom
Sakina-786-vi:feat/userRegister_crash
Open

Feat/user register crash#87
Sakina-786-vi wants to merge 2 commits into
avishek0769:mainfrom
Sakina-786-vi:feat/userRegister_crash

Conversation

@Sakina-786-vi
Copy link
Copy Markdown

Closes #26

What changed

Added two guard clauses in userRegister inside backend/controllers/user.controller.js before accessing existingUser.isVerified:

  • If email doesn't exist in DB → 400 "Email not verified. Request a verification code first."
  • If email exists but not verified → 400 "User not verified"

Previously, accessing .isVerified on a null user caused an unhandled crash.

@avishek0769 avishek0769 added easy This issue is easy to solve SSoC26 Social Summer of Code - 2026 labels May 29, 2026
@avishek0769
Copy link
Copy Markdown
Owner

Your PR includes a commit made on 27th May for fixing another issue. Remove that commit and only keep the relevant commits which fixes the mentioned issue.

@Sakina-786-vi Sakina-786-vi force-pushed the feat/userRegister_crash branch from 2fa0fff to ee3e365 Compare May 29, 2026 12:30
@avishek0769
Copy link
Copy Markdown
Owner

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

easy This issue is easy to solve SSoC26 Social Summer of Code - 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix userRegister crash when the email row does not exist

2 participants