<?php
require '../vendor/autoload.php'; // Ensure this is correct
require 'config_pdo.php';

use Firebase\JWT\JWT;

$payload = [
    "iss" => "your_domain.com",
    "iat" => time(),
    "exp" => time() + 3600, // Token expires in 1 hour
    "sub" => 1 // Example: User ID
];

$token = JWT::encode($payload, JWT_SECRET_KEY, "HS256");

echo json_encode(["token" => $token]);
?>
