php - How to get the $user object when authenticated with JWT on Laravel/Lumen? -


i have application authentication jwt. first time creating one. when try user object in function, can't find way it. here code:

public function getemail(\illuminate\http\request $request) {     $user = \auth::user();      return new jsonresponse(['message' => $user->email]); } 

it returns $user object null, because auth class related session authentication. using boilerplate: https://github.com/krisanalfa/lumen-jwt

i have looked code can't find way user, can out?

have tried using function?

jwtauth::user();


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -