Fix driver token table and IV padding

This commit is contained in:
Hamza-Ayed
2026-04-25 11:48:52 +03:00
parent fe5fa1feff
commit d78da5de88
3 changed files with 10 additions and 4 deletions

View File

@@ -561,7 +561,7 @@ class AuthController extends Controller
}
// Security Check: Verify fingerprint matches stored token
$storedToken = DB::connection('primary')->table('captainToken')
$storedToken = DB::connection('primary')->table('driverToken')
->where('captain_id', $driver->id)
->first();
@@ -571,14 +571,14 @@ class AuthController extends Controller
return $this->failure('Security mismatch: Invalid device fingerprint', 403);
}
// Update fingerprint and token
DB::connection('primary')->table('captainToken')->where('captain_id', $driver->id)
DB::connection('primary')->table('driverToken')->where('captain_id', $driver->id)
->update([
'fingerPrint' => $request->input('fingerPrint'),
'token' => $request->input('fcm_token'),
'updated_at' => now()
]);
} else {
DB::connection('primary')->table('captainToken')->insert([
DB::connection('primary')->table('driverToken')->insert([
'captain_id' => $driver->id,
'fingerPrint' => $request->input('fingerPrint'),
'token' => $request->input('fcm_token'),