-1
I’m trying to use the Auth::Attempt method to log in to my api, but it always falls into Else, even when it has in the database the correspondence of that email/password. Where can I set up this Auth::atempt method? I believe that it should take the default parameter of the Laravel which is email/password, and as I switched to email/password it does not find?
My job:
function login(Request $request){
if (Auth::attempt(['email' => $request->email, 'senha' => $request->senha])){
return 'Autenticado com sucesso';
}else{
return response()->json([
'error' => 'Nome de usuário ou senha incorretos',
'code' => 401,], 401);
}
}
She always falls in Isis..
In my logging function Hash::make is used, it somehow impacts Auth::atempt?
return User::create([
'nome' => $data['nome'],
'email' => $data['email'],
'telefone' => $data['telefone'],
'usuario_anjo' => $data['usuario_anjo'],
'senha' => Hash::make($data['senha']),
]);
@Edit:
I did a test replacing the Hash::make for bcrypty but still falls in LSE...
You changed the table because?
– novic