Laravel seed project gives NULL when trying to fetch the user


I’ve an application which is using the traditional Authentication as provided by Laravel. We want to replace this with Auth0, and we are trying to set it up using the Laravel’s seed project and following the provided tutorial.

We followed it line by line. Everything worked perfectly except that when we try to var_dump() the Auth::user() from our callback function, it gives null. And Auth::check(), as expected, gives false. So, for some reason, the Session is not set after the callback is executed.

Looking through the forums I can see a lot of people is having the same problem, most of them with Laravel 5.4, which is the one we are using.

Is it a known problem? Is there any fix? Shall we just try the classic PHP approach or implement it manually?


This answer may solve your issue in case you’re running into the same problem: