mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-12-23 23:02:08 +03:00
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:
@@ -11,9 +11,6 @@ class OidcController extends Controller
|
||||
{
|
||||
protected OidcService $oidcService;
|
||||
|
||||
/**
|
||||
* OpenIdController constructor.
|
||||
*/
|
||||
public function __construct(OidcService $oidcService)
|
||||
{
|
||||
$this->oidcService = $oidcService;
|
||||
@@ -65,16 +62,10 @@ class OidcController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* OIDC Logout Feature: Start the authorization logout flow via OIDC.
|
||||
* Log the user out then start the OIDC RP-initiated logout process.
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
try {
|
||||
return $this->oidcService->logout();
|
||||
} catch (OidcException $exception) {
|
||||
$this->showErrorNotification($exception->getMessage());
|
||||
return redirect('/logout');
|
||||
}
|
||||
return redirect($this->oidcService->logout());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user