laravel / socialite

Laravel wrapper around OAuth 1 & OAuth 2 libraries.

Home Page:https://laravel.com/docs/socialite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth::logoutOtherDevices() not working when user registered with Socialite and password is null

khalyomede opened this issue · comments

  • 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:

  1. Register with Google
  2. Create a controller with a method that contains this code
public function destroyOtherDevices()
{
  try {
    Auth::logoutOtherDevices('');
  } catch (InvalidArgumentException) {
    dd("invalid password");
  }

  dd("ok");
}
  1. You will see "invalid password"

This method can only be used for users with a password.