Skip to content

fix(server): handle database write errors inside login comparePassword callback#30

Open
Pratikshya32 wants to merge 1 commit into
Mayank10123:mainfrom
Pratikshya32:fix-login-error-handling
Open

fix(server): handle database write errors inside login comparePassword callback#30
Pratikshya32 wants to merge 1 commit into
Mayank10123:mainfrom
Pratikshya32:fix-login-error-handling

Conversation

@Pratikshya32

Copy link
Copy Markdown

This pull request resolves a vulnerability where uncaught database write errors inside the user login validation callback crash the Node server process.

Changes

  • Wrapped the asynchronous user.comparePassword callback implementation inside a try-catch block.
  • Catches database connection/write errors during await user.save() and returns a standard 500 server error response.

Closes #29

@vercel

vercel Bot commented May 20, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the mayank10123's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Bug: Uncaught database write exceptions in comparePassword login callback crash server

1 participant