Closed chrisvidal closed 6 years ago
From your question I see you need just User model instance not user's session. To achieve this you need to get user's id from token and then get the model:
$user_id = JWTAuth::authenticate($token)->id;
// or
$user_id = JWTAuth::parseToken()->authenticate()->id;
// then
$model = UserModel::findOrFail($user_id);
ok thanks, I came up with
$token = JWTAuth::parseToken()->getToken();
$user = JWTAuth::authenticate( $token );
Hi, How to retrieve the User session after login? I am building API using this plugin to handle the authentication. How do I get the logged user session? I tried the usual
but it does not work
thanks