Files
This commit is contained in:
@ -1,12 +1,8 @@
|
||||
<?php
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Incoviba\API\Common\Service\Auth as Service;
|
||||
use Incoviba\API\Common\Controller\Auth;
|
||||
|
||||
$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');
|
||||
});
|
||||
$app->post('/auth/login[/]', [Auth::class, 'login']);
|
||||
$app->get('/auth/generate[/]', [Auth::class, 'generate']);
|
||||
$app->post('/auth/validate[/]', [Auth::class, 'validate']);
|
||||
$app->post('/auth/user[/]', [Auth::class, 'user']);
|
||||
$app->post('/auth/logout[/]', [Auth::class, 'logout']);
|
||||
|
Reference in New Issue
Block a user