new system prototype
This commit is contained in:
13
handlers/logout.php
Normal file
13
handlers/logout.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?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]);
|
||||
Reference in New Issue
Block a user