Skip to content

Don't crash login for a user without a password_hash - #252

Merged
pradeeban merged 1 commit into
KathiraveluLab:mainfrom
madhavzanwar:fix/login-missing-password-hash
Oct 17, 2026
Merged

pradeeban merged 1 commit into
KathiraveluLab:mainfrom
madhavzanwar:fix/login-missing-password-hash

Conversation

@madhavzanwar

Copy link
Copy Markdown
Contributor

If a user document has no password_hash, User.check_password calls check_password_hash(None, ...), which raises AttributeError, and login ends in a 500.

Change: check_password in dreams_app/app/models.py returns False when there’s no hash, so the user sees the normal “Invalid username or password”. I added a test in tests/test_auth.py.

check_password_hash(None, ...) raised AttributeError and login ended in a
500. Return False from User.check_password when there is no hash, and add
a test.
Copilot AI balanced review requested due to automatic review settings October 17, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@pradeeban
pradeeban merged commit d417620 into KathiraveluLab:main Oct 17, 2026
1 of 3 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.

3 participants