Rebuild
This commit is contained in:
23
public/page/auth_logout.php
Normal file
23
public/page/auth_logout.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
use App\OidcClient;
|
||||
|
||||
$config = app()->config();
|
||||
$session = app()->session();
|
||||
$session->start();
|
||||
|
||||
$idToken = null;
|
||||
if (!empty($_SESSION['auth_user']['id_token'])) {
|
||||
$idToken = (string)$_SESSION['auth_user']['id_token'];
|
||||
}
|
||||
|
||||
unset($_SESSION['auth_user']);
|
||||
|
||||
if ($config->authEnabled) {
|
||||
$client = new OidcClient($config);
|
||||
$url = $client->logoutUrl($idToken);
|
||||
if ($url) {
|
||||
redirect($url);
|
||||
}
|
||||
}
|
||||
|
||||
redirect('/');
|
||||
Reference in New Issue
Block a user