I want to extend the Laravel stock authentication to use an OAuth server for user retrieval and authentication while taking advantage of the existing functionality. I alread
Recently I've had the same problem, so maybe the solution is something like this.
updateSession($user->getAuthIdentifier());
if ($remember) {
$this->refreshRememberToken($user);
$this->queueRecallerCookie($user);
}
$this->fireLoginEvent($user, $remember);
$this->setUser($user);
}
}
In AppServiceProvider.php
public function boot()
{
Auth::extend(
'sessionExtended',
function ($app) {
$provider = new EloquentUserProvider($app['hash'], config('auth.providers.users.model'));
return new SessionGuardExtended('sessionExtended', $provider, app()->make('session.store'), request());
}
);
}
In Config/auth.php driver should be renamed
'web' => [
'driver' => 'sessionExtended',
'provider' => 'users',
],