Files
This commit is contained in:
12
resources/routes/auth.php
Normal file
12
resources/routes/auth.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Incoviba\API\Common\Service\Auth as Service;
|
||||
|
||||
$app->get('/auth/generate', function(Request $request, Response $response, Service $service): Response {
|
||||
$key = $service->generate();
|
||||
$response->getBody()->write(json_encode(['key' => $key]));
|
||||
return $response
|
||||
->withStatus(200)
|
||||
->withHeader('content-type', 'application/json');
|
||||
});
|
Reference in New Issue
Block a user