14 lines
292 B
PHP
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]);
|