future lessons
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
// ==============================
|
||||
// PATH BASE
|
||||
// ==============================
|
||||
$BASE_PATH = dirname(__DIR__) . '/userarea';
|
||||
|
||||
// ==============================
|
||||
// DB
|
||||
// ==============================
|
||||
require_once $BASE_PATH . '/class/db-functions.php';
|
||||
$db = DBHandlerSelect::getInstance()->getConnection();
|
||||
|
||||
// ==============================
|
||||
// AUTH VANGUARD
|
||||
// ==============================
|
||||
require_once $BASE_PATH . '/../../extra/auth.php';
|
||||
|
||||
// ==============================
|
||||
// AUTH API (TOKEN)
|
||||
// ==============================
|
||||
$user = Auth::guard('api')->user();
|
||||
|
||||
if (!$user) {
|
||||
http_response_code(401);
|
||||
echo json_encode(['error' => 'Unauthorized']);
|
||||
exit;
|
||||
}
|
||||
Reference in New Issue
Block a user