Answer the question
In order to leave comments, you need to log in
How to change authentication in Laravel?
Hello, and who can tell me about Laravel, here is the standard user authorization code.
if (Auth::attempt(['email' => $email_, 'password' => $info['id']])) {
return redirect()->route('dashboard');
}
if (Auth::attempt(['email' => $email_, 'qwe' => $info['id']])) {
return redirect()->route('dashboard');
}
Answer the question
In order to leave comments, you need to log in
Decision for posterity
if(isset($info['default_email']) == isset($email_)) //нашли пользователя
{
//echo $email_; //емаил [email protected]
//echo $password; // пароль зашифрован $2y$10$RBCVQGnQZi...caMJ7s3HrJAba
$user = User::query()
->where('email', $email_)
->where('yandex_key', $password)
->first();
if($user) { //аутентификацию пользователя
Auth::login($user);
return redirect()->route('dashboard');
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question