Auth: Refactored OIDC RP-logout PR code, Extracted logout

Extracted logout to the login service so the logic can be shared instead
of re-implemented at each stage. For this, the SocialAuthService was
split so the driver management is in its own class, so it can be used
elsewhere without use (or circular dependencies) of the
SocialAuthService.

During review of #4467
This commit is contained in:
Dan Brown
2023-12-06 13:49:53 +00:00
parent cc10d1ddfc
commit bba7dcce49
17 changed files with 263 additions and 288 deletions

View File

@@ -71,8 +71,7 @@ class Saml2Service
throw $error;
}
$this->actionLogout();
$url = '/';
$url = $this->loginService->logout();
$id = null;
}
@@ -140,20 +139,11 @@ class Saml2Service
);
}
$this->actionLogout();
$this->loginService->logout();
return $redirect;
}
/**
* Do the required actions to log a user out.
*/
protected function actionLogout()
{
auth()->logout();
session()->invalidate();
}
/**
* Get the metadata for this service provider.
*