Files
nat-as-server/handlers/logout.php
2026-04-15 10:19:42 +02:00

14 lines
292 B
PHP

<?php
if ($method !== 'DELETE' && $method !== 'POST') {
json_error('METHOD_NOT_ALLOWED', 'Method not allowed', 405);
}
$token = get_bearer_token();
if (!$token) {
json_error('UNAUTHORIZED', 'Missing Bearer token', 401);
}
token_revoke($token);
json_success(['loggedOut' => true]);