I am doing a login system with Laravel using JWT, however I need to pass 3 parameters, being they an identifier, username and password. I can get these parameters but I can not authenticate with the bank. It does user verification and password, but from that first parameter (the handle, which is needed to mount the menu) it does not check. Has anyone used JWT passing 3 parameters? How can I check these 3 parameters?
I'm using link . Here is an excerpt from my code:
public function authenticateJson(Request $request) {
// pega as credenciais para o login
$credentials = $request->only('login', 'password');
$customClaims = ['ep_chave' => $request->only('ep_chave')];
try {
// verifica o login e cria o token
if (! $token = JWTAuth::attempt($credentials, $customClaims)) {
return response()->json(['error' => 'Login ou senha inválidos'], 401);
}
} catch (JWTException $e) {
//Erro para Criar o token
return response()->json(['error' => 'Não foi possível criar o token'], 500);
}
// Caso tudo ok retorna o token
return response()->json(compact('token'));
}