Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?php

namespace Visol\ShibbolethAuth\Hook;
namespace Visol\ShibbolethAuth\EventListener;

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\Authentication\Event\AfterUserLoggedOutEvent;
use TYPO3\CMS\Core\Utility\StringUtility;

/**
Expand All @@ -17,10 +19,13 @@
* The TYPO3 project - inspiring people to share!
*/

class UserAuthentication
#[AsEventListener(
identifier: 'shibboleth-auth/logout-listener',
)]
final readonly class LogoutListener
{

public function backendLogoutHandler()
public function __invoke(AfterUserLoggedOutEvent $event): void
{
// Delete the Shibboleth session cookie
foreach ($_COOKIE as $name => $value) {
Expand Down
5 changes: 0 additions & 5 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use Visol\ShibbolethAuth\Controller\FrontendLoginController;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use Visol\ShibbolethAuth\Hook\UserAuthentication;
use Visol\ShibbolethAuth\LoginProvider\ShibbolethLoginProvider;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
Expand All @@ -23,10 +22,6 @@

$GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['setup']['BE_fetchUserIfNoSession'] = $extensionConfiguration['BE_fetchUserIfNoSession'];

// Register backend logout handler
// TODO: Replace with https://docs.typo3.org/permalink/t3coreapi:afteruserloggedoutevent
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'][] = UserAuthentication::class . '->backendLogoutHandler';

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['backend']['loginProviders'][1518433441] = [
'provider' => ShibbolethLoginProvider::class,
'sorting' => 60,
Expand Down