mirror of
https://github.com/ceratic/MediaCollectorLibary.git
synced 2026-05-13 23:56:46 +02:00
Enhance API functionality and improve JWT authentication
- Added JWT authentication support in AuthService and JwtService. - Implemented token generation and refresh mechanisms. - Updated ApiAuthMiddleware to handle authentication for protected routes. - Created ApiController and BaseApiController for standardized API responses. - Developed MediaController for managing media items with pagination and search capabilities. - Introduced DocsController for serving API documentation via Swagger UI. - Added routes for API documentation and media management. - Improved error handling and response formatting across API endpoints. - Updated composer.json to include necessary JWT and Swagger UI dependencies.
This commit is contained in:
@@ -97,6 +97,9 @@ $container->set('view', function () use ($container) {
|
||||
case 'admin.playnite.upload':
|
||||
$basePath = '/admin/playnite/import';
|
||||
break;
|
||||
case 'admin.games.edit':
|
||||
$basePath = '/admin/games/' . $data['id'] . '/edit';
|
||||
break;
|
||||
case 'admin.sync':
|
||||
$basePath = '/admin/sync/' . ($data['id'] ?? '');
|
||||
break;
|
||||
@@ -483,6 +486,9 @@ $container->set(\App\Http\Middleware\MediaVisibilityMiddleware::class, function
|
||||
AppFactory::setContainer($container);
|
||||
$app = AppFactory::create();
|
||||
|
||||
// Add Method Override Middleware for handling _METHOD field in forms
|
||||
$app->add(new \Slim\Middleware\MethodOverrideMiddleware());
|
||||
|
||||
// Add Twig-View Middleware
|
||||
$twig = $container->get('view');
|
||||
$app->add(TwigMiddleware::create($app, $twig));
|
||||
@@ -560,5 +566,6 @@ $errorMiddleware = $app->addErrorMiddleware(
|
||||
// Register routes
|
||||
require __DIR__ . '/../routes/web.php';
|
||||
require __DIR__ . '/../routes/api.php';
|
||||
require __DIR__ . '/../routes/api2.php';
|
||||
|
||||
$app->run();
|
||||
|
||||
Reference in New Issue
Block a user