frandy's avatar

How to authentication in jwt without password lumen and get token

i try to get token using email with this code but i get error . $user=User::where('email','=','[email protected])->first();

if (!$userToken=JWTAuth::fromUser($user)) { return response()->json(['error' => 'invalid_credentials'], 401); }

return response()->json(compact('userToken'));

got error like-> ErrorException in JWT.php line 59: Argument 1 passed to Tymon\JWTAuth\JWT::fromUser() must be an instance of Tymon\JWTAuth\Contracts\JWTSubject, instance of App\Model\User given, called in C:\wamp\www\project\vendor\illuminate\support\Facades\Facade.php on line 217 and defined. Please help me how authentication without password.

0 likes
0 replies

Please or to participate in this conversation.