Filament::auth()->login();
Situation:
I tried to do before but that does not help.
Am I missing something?
- I am logged in to panel as User1
- I go to page which is outside of panel.
- In that page I call ($anotherUserModel is another user)
- Then I redirect back to my panel
- And I get error. And I'm not logged in as $anotherUserModel
I tried to do before but that does not help.
Am I missing something?
Solution
Thanks for your effort. Actually I needed to call these, if user is currently logged in:
And now everything works fine,
Thanks again.
Filament::auth()->logout()session()->invalidate()session()->regenerateToken()And now everything works fine,
Filament::auth()->login($model) does its job.Thanks again.