You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
613 B
24 lines
613 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
|
use Symfony\Component\HttpFoundation\Request as HttpRequest;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
require_once __DIR__.'/../../../main/inc/global.inc.php';
|
|
|
|
$request = HttpRequest::createFromGlobals();
|
|
|
|
$response = new JsonResponse([], Response::HTTP_METHOD_NOT_ALLOWED);
|
|
|
|
if ('POST' === $request->getMethod()) {
|
|
$token = base64_encode(uniqid());
|
|
|
|
$response->setStatusCode(Response::HTTP_OK);
|
|
$response->setData(['auth-token' => $token]);
|
|
}
|
|
|
|
$response->send();
|
|
|