Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] – Override default EloquentUserProvider to check $user->authPassword before checking hashes match #367

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

joelbutcher
Copy link
Owner

@joelbutcher joelbutcher commented Jul 30, 2024

Resolves #366

The problem is that when ever anyone has "registered" with a provider, the users.password field is set to NULL in the database. Therefore attempting to authenticate a user with their email and password throws an error exception, presenting itself as a 500 server error.

The default eloquent user provider (rightly) assumes that the user.password column is always filled with a password hash (as is the default behaviour of every Laravel app). This results in the underlying hasher checking a hashed password from the form against NULL, which throws the error.

The fix here is to override the eloquent user provider with our own user provider. This provider only extends the base one and only overrides the methods that matter (in this case only the validateCredentials method).

@joelbutcher joelbutcher merged commit 5309717 into 6.x Jul 30, 2024
38 checks passed
@joelbutcher joelbutcher deleted the fix/empty-password-bcrypt-error branch July 30, 2024 13:01
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.

This password does not use the Bcrypt algorithm.
1 participant