Merge pull request #422 from openclassify/dia

#1074 Add country select for login
This commit is contained in:
Fatih Alp 2020-03-17 13:11:59 +03:00 committed by GitHub
commit f58c3287d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,13 @@ class ValidateCredentials
//Is email or phone number //Is email or phone number
if (!filter_var($credentials['email'], FILTER_VALIDATE_EMAIL)) { if (!filter_var($credentials['email'], FILTER_VALIDATE_EMAIL)) {
if ($user = $this->repository->findBy('gsm_phone', $credentials['email'])) { $possiblePhone = $credentials['email'];
if (substr($credentials['email'], 0, 1) == 0) {
$possiblePhone = substr($credentials['email'], 1);
}
if ($user = $this->repository
->newQuery()
->where('gsm_phone', 'LIKE', "%$possiblePhone")->first()) {
$credentials['email'] = $user->email; $credentials['email'] = $user->email;
} }
} }