Applied manual JWT check and restored all driver fields

This commit is contained in:
Hamza-Ayed
2026-04-25 12:13:28 +03:00
parent 8545c09b76
commit b85e49f4b8
2 changed files with 13 additions and 14 deletions

View File

@@ -294,20 +294,21 @@ class OtpController extends Controller
return $this->failure('Phone parameter is missing', 400);
}
// We check phone_verification table (Legacy V1 style)
$verified = DB::connection('primary')->table('phone_verification')
->where('phone_number', $phone)
->where('verified', 1) // In V1 it might be 'verified' or 'is_verified'
->exists();
// Fallback for column name 'is_verified' if 'verified' fails
if (!$verified) {
try {
$verified = DB::connection('primary')->table('phone_verification')
->where('phone_number', $phone)
->where('verified', 1) // In V1 it might be 'verified' or 'is_verified'
->exists();
} catch (\Exception $e) {
// Fallback for column name 'is_verified' if 'verified' fails
try {
$verified = DB::connection('primary')->table('phone_verification')
->where('phone_number', $phone)
->where('is_verified', 1)
->exists();
} catch (\Exception $e) {}
} catch (\Exception $e2) {
$verified = false;
}
}
return response()->json([