go-learn/server/api/me.php
sab.code.lab 1c85091186 chore: восстановление репозитория из снапшота v0.3.1
Прежняя git-история утрачена при переносе проекта на машину владельца
(снапшот без .git). Хэши коммитов в docs/reports/* относятся к утраченной
истории.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 09:34:02 +02:00

24 lines
431 B
PHP

<?php
declare(strict_types=1);
/**
* GET /api/me.php → 200 {email} | 401.
*/
require __DIR__ . '/../lib/http.php';
require __DIR__ . '/../lib/db.php';
require __DIR__ . '/../lib/auth.php';
http_security_headers();
try {
method_must('GET');
$user = require_user(db());
json_out(['email' => $user['email']]);
} catch (Throwable $e) {
error_log('me: ' . $e->getMessage());
error_out(500, 'internal');
}