Hi,
I know , that exists way how to login users by theirs ids:
Auth::loginUsingId($user_id)
but how to do it in JWT Auth? I tried something like this:
JWTAuth::loginUsingId($user_id)
but it returns me error: Method loginUsingId does not exist!
So, how to login user by their user_id in jwt auth?
JWTAuth is token base login system whereas Auth is basic authentication system.
As JWTAuth require token, you can pass token in user object like:
$user = User::find($user_id);
JWTAuth::fromUser($user);
Get more idea for create token Hope this works!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community