Applied manual JWT check and restored all driver fields
This commit is contained in:
@@ -456,17 +456,15 @@ class AuthController extends Controller
|
|||||||
->leftJoin('invites', 'invites.inviterDriverPhone', '=', 'd.phone')
|
->leftJoin('invites', 'invites.inviterDriverPhone', '=', 'd.phone')
|
||||||
->leftJoin('driver_gifts', 'driver_gifts.driver_id', '=', 'd.id')
|
->leftJoin('driver_gifts', 'driver_gifts.driver_id', '=', 'd.id')
|
||||||
->leftJoin('CarRegistration', 'CarRegistration.driverID', '=', 'd.id')
|
->leftJoin('CarRegistration', 'CarRegistration.driverID', '=', 'd.id')
|
||||||
->leftJoin('captain_bank', 'captain_bank.captain_id', '=', 'd.id')
|
|
||||||
->select([
|
->select([
|
||||||
'd.id', 'd.phone', 'd.email', 'd.gender', 'd.status',
|
'd.id', 'd.phone', 'd.email', 'd.gender', 'd.status',
|
||||||
'd.first_name', 'd.last_name',
|
'd.first_name', 'd.last_name', 'd.name_arabic',
|
||||||
'd.name_arabic',
|
'd.birthdate', 'd.site', 'd.employmentType', 'd.maritalStatus',
|
||||||
'd.accountBank', 'd.bankCode',
|
'd.accountBank', 'd.bankCode',
|
||||||
'phone_verification.verified as is_verified',
|
'phone_verification.verified as is_verified',
|
||||||
'invites.isInstall',
|
'invites.isInstall', 'invites.isGiftToken',
|
||||||
'driver_gifts.is_claimed',
|
'driver_gifts.is_claimed',
|
||||||
'CarRegistration.make', 'CarRegistration.model', 'CarRegistration.year',
|
'CarRegistration.make', 'CarRegistration.model', 'CarRegistration.year',
|
||||||
'captain_bank.bankCode as bank_code_alt', 'captain_bank.accountBank as account_bank_alt',
|
|
||||||
])
|
])
|
||||||
->where('d.id', $id)
|
->where('d.id', $id)
|
||||||
->first();
|
->first();
|
||||||
|
|||||||
@@ -294,20 +294,21 @@ class OtpController extends Controller
|
|||||||
return $this->failure('Phone parameter is missing', 400);
|
return $this->failure('Phone parameter is missing', 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We check phone_verification table (Legacy V1 style)
|
try {
|
||||||
$verified = DB::connection('primary')->table('phone_verification')
|
$verified = DB::connection('primary')->table('phone_verification')
|
||||||
->where('phone_number', $phone)
|
->where('phone_number', $phone)
|
||||||
->where('verified', 1) // In V1 it might be 'verified' or 'is_verified'
|
->where('verified', 1) // In V1 it might be 'verified' or 'is_verified'
|
||||||
->exists();
|
->exists();
|
||||||
|
} catch (\Exception $e) {
|
||||||
// Fallback for column name 'is_verified' if 'verified' fails
|
// Fallback for column name 'is_verified' if 'verified' fails
|
||||||
if (!$verified) {
|
|
||||||
try {
|
try {
|
||||||
$verified = DB::connection('primary')->table('phone_verification')
|
$verified = DB::connection('primary')->table('phone_verification')
|
||||||
->where('phone_number', $phone)
|
->where('phone_number', $phone)
|
||||||
->where('is_verified', 1)
|
->where('is_verified', 1)
|
||||||
->exists();
|
->exists();
|
||||||
} catch (\Exception $e) {}
|
} catch (\Exception $e2) {
|
||||||
|
$verified = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
|
|||||||
Reference in New Issue
Block a user