Framework: logoutOtherDevices only work on default guard

Created on 10 Jan 2019  路  4Comments  路  Source: laravel/framework

  • Laravel Version: 5.7.20
  • PHP Version: 7.2.12
  • Database Driver & Version:

Description:

I can logout other devices but it only work on default guard. When i change default guard, it work correctly.

Steps To Reproduce:

  • create new guard and admin table.
  • use logoutOtherDevices on new guard ( it not work ).
  • change default guard to new guard and use logoutOtherDevices on default guard ( it work) but still not work on web guard ( not a default guard)

    R.I.P my english =))

Most helpful comment

it is not working in laravel 5.7
Auth::logoutOtherDevices($data['password'], 'password');
and
Auth::guard('web')->logoutOtherDevices($data['password'], 'password');
are ok but below code is not working
Auth::guard('custom')->logoutOtherDevices($data['password'], 'password');

@driesvints i can't find any solution or asked question on forums or stackoverflow and i test it with Auth::attempt or Auth::loginUsingId but not working

and i also uncomment this in middlewareGroups AuthenticateSession
and use web middelware in all routes but not working with custom guard
to solve this problem i used this answer

All 4 comments

Can you give us some more context with code examples if this is an issue/bug with the framework itself?

If this is not an issue or bug with the framework, there are many great community support areas that will likely give you a better answer more quickly:

Laravel Slack (https://larachat.co/)
Laravel.io Forum (https://laravel.io/forum)
Laracasts Forum (https://laracasts.com/discuss)
StackOverflow (http://stackoverflow.com/questions/tagged/laravel)

Thanks!

Can you first please try one of the following support channels? If you can actually identify this as a bug, feel free to report back.

it is not working in laravel 5.7
Auth::logoutOtherDevices($data['password'], 'password');
and
Auth::guard('web')->logoutOtherDevices($data['password'], 'password');
are ok but below code is not working
Auth::guard('custom')->logoutOtherDevices($data['password'], 'password');

@driesvints i can't find any solution or asked question on forums or stackoverflow and i test it with Auth::attempt or Auth::loginUsingId but not working

and i also uncomment this in middlewareGroups AuthenticateSession
and use web middelware in all routes but not working with custom guard
to solve this problem i used this answer

From my side also is not working in laravel 5.7

I have implement with different variations but can't work , Please suggest me any solution thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RomainSauvaire picture RomainSauvaire  路  3Comments

jackmu95 picture jackmu95  路  3Comments

gabriellimo picture gabriellimo  路  3Comments

CupOfTea696 picture CupOfTea696  路  3Comments

lzp819739483 picture lzp819739483  路  3Comments