#Custom user provider: User not set in session

4 messages · Page 1 of 1 (latest)

vagrant jackal
#

Good evening,

so I've implemented a custom user provider in one of our applications. Retrieving the data and works fine, dd'ing differnet points in the SessionGuard also seems to be working, the custom model is passed correctly everywhere. We use the database driver to store the sessions. For some reason tho, when the DatabaseSessionHandler receives the custom guard (which it does), the user is null. I've tried some debugging within the framework but I can't seem to figure out where the data is lost between the SessionGuard and DatabaseSessionHandler. I've also searched the internet finding similar problems but unfortunately no solutions.

Any help appreciated!

ocean flare
vagrant jackal
#

No, the problem is that the user isnt saved to the session database 🙂

#

The actual user data comes from a rest api, which is not compatible with laravel's eloquent model. So I've implemented a custom user provider and guard to authenticate users using that api, but for some reason when the guard is passed to the DatabaseSessionHandler the user suddenly becomes null