I'm thinking of a way to authenticate users using email and the CPF of it, so far I have not found a way to do it, does anyone have a suggestion?
public function auth(Request $request) {
$credenciais = $request->only('cli_email', 'cli_cpf');
}
I'm thinking of a way to authenticate users using email and the CPF of it, so far I have not found a way to do it, does anyone have a suggestion?
public function auth(Request $request) {
$credenciais = $request->only('cli_email', 'cli_cpf');
}
The Laravel Framework has a form of authentication with the class User
instance, so you can check other relevant data for your purpose to access the system, for example:
$user = User::where('cpf', $cpf)->where('email', $email)->first();
if ($user) // se verdade existe um usuário com essas informações
{
Auth::login($user); //efetuando a operação de autenticação
}
But, would not it be a security flaw ?, because it is easy to find out the CPF and E-mail of some user, the password should also be informed by be a data of each user.