<?php
    use AxiumPHP\Core\Router;
    use Workbloom\Component\Auth\v0\Middlewares\AuthMiddleware;
    use Workbloom\Component\Auth\v0\Controllers\AuthController;

    // Rota de login
    Router::POST(
        uri: '/login',
        handler: [AuthController::class, 'login']
    );

    // Rotas Logadas
    Router::group(
        prefix: '',
        callback: function() {
            // Lista Contextos de Trabalho
            Router::GET(
                uri: '/work-contexts',
                handler: [AuthController::class, 'listWorkContexts']
            );

            // Seleção do contexto de trabalho
            Router::POST(
                uri: '/select-work-context',
                handler: [AuthController::class, 'selectWorkContext']
            );

            // Logout
            Router::POST(
                uri: '/logout',
                handler: [AuthController::class, 'logout']
            );
        },
        middlewares: [
            [AuthMiddleware::class, 'handle']
        ]
    );
