class ExternalBaseUserProvider implements UserProvider
{
-
/**
* The user model.
*
/**
* LdapUserProvider constructor.
- * @param $model
+ *
+ * @param $model
*/
public function __construct(string $model)
{
public function createModel()
{
$class = '\\' . ltrim($this->model, '\\');
- return new $class;
+
+ return new $class();
}
/**
* Retrieve a user by their unique identifier.
*
- * @param mixed $identifier
+ * @param mixed $identifier
+ *
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveById($identifier)
/**
* Retrieve a user by their unique identifier and "remember me" token.
*
- * @param mixed $identifier
- * @param string $token
+ * @param mixed $identifier
+ * @param string $token
+ *
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveByToken($identifier, $token)
return null;
}
-
/**
* Update the "remember me" token for the given user in storage.
*
- * @param \Illuminate\Contracts\Auth\Authenticatable $user
- * @param string $token
+ * @param \Illuminate\Contracts\Auth\Authenticatable $user
+ * @param string $token
+ *
* @return void
*/
public function updateRememberToken(Authenticatable $user, $token)
/**
* Retrieve a user by the given credentials.
*
- * @param array $credentials
+ * @param array $credentials
+ *
* @return \Illuminate\Contracts\Auth\Authenticatable|null
*/
public function retrieveByCredentials(array $credentials)
{
// Search current user base by looking up a uid
$model = $this->createModel();
+
return $model->newQuery()
->where('external_auth_id', $credentials['external_auth_id'])
->first();
/**
* Validate a user against the given credentials.
*
- * @param \Illuminate\Contracts\Auth\Authenticatable $user
- * @param array $credentials
+ * @param \Illuminate\Contracts\Auth\Authenticatable $user
+ * @param array $credentials
+ *
* @return bool
*/
public function validateCredentials(Authenticatable $user, array $credentials)