Add SportPath auth APIs and training content foundation

This commit is contained in:
Hamza-Ayed
2026-10-04 00:49:48 +03:00
parent e7f3c777d1
commit 5b90da6b18
23 changed files with 1451 additions and 238 deletions
+19
View File
@@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
require_once dirname(__DIR__, 4) . '/backend/JwtToken.php';
require_once dirname(__DIR__, 4) . '/backend/ApiAuth.php';
require_once dirname(__DIR__) . '/_bootstrap.php';
api_method('POST');
$auth = ApiAuth::bearerClaims();
try {
$db = Database::getInstance();
$stmt = $db->prepare('UPDATE auth_sessions SET revoked_at = COALESCE(revoked_at, UTC_TIMESTAMP()) WHERE session_uuid = ?');
$stmt->bind_param('s', $auth['session_id']);
$stmt->execute();
$stmt->close();
api_json(['status' => 'signed_out']);
} catch (Throwable $exception) {
error_log('Session revocation failed: ' . $exception->getMessage());
api_json(['error' => 'service_unavailable'], 503);
}