Auth::logoutOtherDevices() not working when user registered with Socialite and password is null
khalyomede opened this issue · comments
Khalyomede commented
- Socialite Version: 5.5.2
- Laravel Version: 9.14.1
- PHP Version: 8.1.5
- Database Driver & Version: MySQL 8.0
Description:
Calling Auth::logoutOtherDevices('')
raise an InvalidArgumentException
exception (probably because the passwords do not match). Since my user is registered using Google via Socialiate, it has a null
value in the password column.
Steps To Reproduce:
- Register with Google
- Create a controller with a method that contains this code
public function destroyOtherDevices()
{
try {
Auth::logoutOtherDevices('');
} catch (InvalidArgumentException) {
dd("invalid password");
}
dd("ok");
}
- You will see "invalid password"
Dries Vints commented
This method can only be used for users with a password.