Skip to content

Commit 4436662

Browse files
committed
fix password check
1 parent afcfcf2 commit 4436662

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Illuminate/Auth/EloquentUserProvider.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function retrieveByCredentials(array $credentials)
107107
{
108108
if (empty($credentials) ||
109109
(count($credentials) === 1 &&
110-
array_key_exists('password', $credentials))) {
110+
Str::contains($this->firstCredentialKey($credentials), 'password'))) {
111111
return;
112112
}
113113

@@ -131,6 +131,19 @@ public function retrieveByCredentials(array $credentials)
131131
return $query->first();
132132
}
133133

134+
/**
135+
* Get the first key from the credential array.
136+
*
137+
* @param array $credentials
138+
* @return string|null
139+
*/
140+
protected function firstCredentialKey(array $credentials)
141+
{
142+
foreach ($credentials as $key => $value) {
143+
return $key;
144+
}
145+
}
146+
134147
/**
135148
* Validate a user against the given credentials.
136149
*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy