18 lines
338 B
PHP
18 lines
338 B
PHP
<?php
|
|
namespace Misuzu;
|
|
|
|
use Misuzu\Users\User;
|
|
|
|
if(!User::hasCurrent()) {
|
|
url_redirect('index');
|
|
return;
|
|
}
|
|
|
|
if(CSRF::validateRequest()) {
|
|
$msz->getSessions()->deleteSessions(sessionTokens: $authToken->getSessionToken());
|
|
AuthToken::nukeCookie();
|
|
url_redirect('index');
|
|
return;
|
|
}
|
|
|
|
Template::render('auth.logout');
|