Authenticated user null

What seems to be the problem:
Looks like authentication user (auth()->user()) is null on ajax requests.

Steps to Reproduce:

  1. Create Livewire Component
  2. In render() method put: info(auth()->user())
  3. On initial load user will be logged
  4. On every new ajax request (for example on wire:click) user will be null.

Are you using the latest version of Livewire: :white_check_mark:

Do you have any screenshots or code examples:
image

I solved this by passing ‘user’ as parameter with mount() method. Not sure if this is right way to do it.

It’s not a wrong way of doing it, but you shouldn’t need to. I don’t know why the auth() helper wouldn’t be working. I personally default to using facades instead of helpers (for no particular reason), and I’ve never had an issue using Auth::user() inside of livewire.