laravellaravel-9laravel-fortify

How to enable LogoutOtherDevices in Laravel Fortify


I am using Laravel Fortify in my custom Laravel Application I have implemented almost all the feature but I can't figure it out how to implement LogoutOtherDevices feature. Also it is not documented anywhere. I have searched many article still did not find any solution.

I also tried to open issue on Laravel/Fortify official github but they did not even see the question and closed issue.


Solution

  • So I have found a solution which is told by a guy name Robert Boes.

    This solution worked for me so the answar was:

    Add the auth.session middleware to your auth routes, then you can call Auth::logoutOtherDevices($password). Fyi, this only works on session-based auth