Skip to content
Advertisement

Laravel Auth guard does not persist after redirect CustomUser

After redirecting from LoginController Auth::guard(‘user’)->user() returns null

JavaScript

LoginConsumer

JavaScript

LoginService

JavaScript

LoginController

Auth::guard(‘web’)->user() returns the right user in each of this layers. But on redirect to route(‘user-home’) (or to any route) the same Auth::guard(‘web’)->user() returns null

JavaScript

auth.php

Advertisement

Answer

The problem was that I didn’t return when implementing IlluminateContractsAuthUserProvider the object from

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement