init
This commit is contained in:
15
api/check_auth.php
Normal file
15
api/check_auth.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if (isset($_SESSION['user_id'])) {
|
||||
echo json_encode([
|
||||
'isLoggedIn' => true,
|
||||
'user' => [
|
||||
'id' => $_SESSION['user_id'],
|
||||
'username' => $_SESSION['username']
|
||||
]
|
||||
]);
|
||||
} else {
|
||||
echo json_encode(['isLoggedIn' => false]);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user