So, the problem i have is the following:
I have this login method. The problem is that the email and password are in an external database. The password has already the hashing done in a specific way that i can't change and because the attempt method hashes the password given in the request to compare it to the database one, it will always fail because the hashing algorithm is not the same. Can i disable that auto hashing? To make it in the way it is done in the other external database?
public function login(Request $request)
{
//Validating the request body
$validator = Validator::make($request->all(), [
'email' => 'required|email',
'password' => 'required',
]);
if($validator->fails()){
return response()->json($validator->errors()->first(), 400);
}
$credentials = $request->only('email', 'password');
if ($token = $this->guard()->attempt($credentials)) {
return $this->respondWithToken($token);
}
return response()->json('Invalid email or password', 401);
}