-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Exception thrown if Application does not have a password field #50497
Comments
I have the same problem as I don't use a password for authentication. Overrode the getAuthPasswordName method in my User model seemed to work if I returned email from it. public function getAuthPasswordName()
{
return "email";
} Not sure if this is a good approach or not but work for now. |
cc @valorin |
@valorin I'm not sure what the behaviour should be if there's an empty password. Should we logout the user in that case? |
The problem is the I'll work on a possible fix. |
Thanks @valorin |
Alright, I've dived deeper into this and it seems to be caused by the I'm having trouble replicating the issue in 11 after enabling it, but I'll keep trying. However, I suspect the issue is actually that this middleware shouldn't be used when you're not using a password. Is there a reason why you're using this middleware? Or can you replicate this issue without this middleware enabled? |
Alright, I replicated the issue and it's definitely that middleware. I've made a PR to silence the issue: #50507 The other fix is to disable the middleware. That could go in the upgrade guide - this middleware is not useful without a password on the user record. |
Laravel Version
11
PHP Version
8.3
Database Driver & Version
No response
Description
Referenced Code: ceb8ed2#r139707506
The previous code snippet makes a hash check, problem is my app does not have a password field this causes the previous method storePasswordHashInSession to set an empty password hash in the session, causing the hash_equals to throw the following exception.
Stackstace via Flare https://flareapp.io/share/J7oDeQZ5#context-request-browser
Steps To Reproduce
Create a new application and remove the password field via the migration
The text was updated successfully, but these errors were encountered: