changes
This commit is contained in:
@@ -126,12 +126,12 @@ class RestAuthApiController extends Controller
|
||||
'required',
|
||||
'string',
|
||||
'email',
|
||||
// function ($attribute, $value, $fail) {
|
||||
// $existingUser = IamPrincipal::where('email_address', $value)->where('principal_type_xid', 4)->whereNull('deleted_at')->exists();
|
||||
// if (!$existingUser) {
|
||||
// $fail('Entered e-mail address is not in our system.');
|
||||
// }
|
||||
// },
|
||||
function ($attribute, $value, $fail) {
|
||||
$existingUser = IamPrincipal::where('email_address', $value)->where('principal_type_xid', 4)->whereNull('deleted_at')->exists();
|
||||
if (!$existingUser) {
|
||||
$fail('The selected email address is invalid.');
|
||||
}
|
||||
},
|
||||
],
|
||||
]);
|
||||
|
||||
@@ -246,4 +246,7 @@ class RestAuthApiController extends Controller
|
||||
return jsonResponseWithErrorMessage(__('error_message.something_went_wrong'), 500);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -160,19 +160,15 @@ class RestAuthApiService
|
||||
{
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
|
||||
$user = IamPrincipal::where('email_address', $request->email_address)
|
||||
->where('principal_type_xid', 4)
|
||||
->whereNull('deleted_at')
|
||||
->exists();
|
||||
|
||||
|
||||
if (!$user) {
|
||||
return jsonResponseWithDataErrorMessageApi(__('EmailNotExist'), ('Entered e-mail address is not in our system. Register for an account here.'));
|
||||
|
||||
}
|
||||
|
||||
|
||||
->first();
|
||||
//use this for both customer and restaurant just change principal_type_xid 4
|
||||
if ($user == null) {
|
||||
Log::error('Email not exist');
|
||||
return jsonResponseWithErrorMessageApi(__('auth.incorrect_email'), 403);
|
||||
}
|
||||
// Define the generateOTP function
|
||||
$otp = $this->generateOTP();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user