Fix: Allow 'unknown' password fallback for wallet login

This commit is contained in:
Hamza-Ayed
2026-04-24 01:12:25 +03:00
parent f6ad0773f3
commit 733f1b98f5
2 changed files with 15 additions and 5 deletions

View File

@@ -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');
}