Implementing this library to a MongoDB is hard. Any thought? or any Idea how to make this possible in mongodb.
Create custom validation and then use login($user) method instead attempt.
$pass=null;
$result=User::where('username',$credentials['username'])
->first();
if ($result->userpassword==$pass && $result->active==1) {
$token = Auth::guard('api')->login($result);
return $this->respondWithToken($token);
}else{
return response()->json([
'page' => 'login',
'error' => $message,
], 401);
}
Create custom validation and then use
login($user)method insteadattempt.$pass=null; $result=User::where('username',$credentials['username']) ->first(); if ($result->userpassword==$pass && $result->active==1) { $token = Auth::guard('api')->login($result); return $this->respondWithToken($token); }else{ return response()->json([ 'page' => 'login', 'error' => $message, ], 401); }
thanks for the reply and I really appreciate it,,, I was able actually to solve my problem, by following the docu on how to set up and it was very awesome, jwt-auth is the best.,,
Most helpful comment
Create custom validation and then use
login($user)method insteadattempt.