fix logout error logging

This commit is contained in:
Bruno Eckhardt committed 2026-07-06 14:21:53 +02:00
1 parent 5305fcabb6
commit 24e11e14a3
1 file changed
+22 -1
+22 -1
View File
@@ -1,3 +1,24 @@
<?php
include_once(__DIR__ . '/modules/Mail.php');
session_destroy();
try {
session_start();
$_SESSION = array();
session_destroy();
http_response_code(200);
exit();
} catch (Exception $e) {
http_response_code(500);
echo json_encode(['error' => 'An error occurred while logging out.']);
sendMail(
"[ERROR] Logout",
"$e",
(new getSpecificData())->getRequestURL(),
true,
);
exit();
}