- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
41 lines
787 B
PHP
41 lines
787 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Application\Auth;
|
|
|
|
use App\Framework\Attributes\Route;
|
|
use App\Framework\Auth\Auth;
|
|
use App\Framework\CommandBus\CommandBus;
|
|
use App\Framework\Http\Method;
|
|
use App\Framework\Router\Result\ViewResult;
|
|
|
|
class ShowLogin
|
|
{
|
|
public function __construct(
|
|
private CommandBus $commandBus,
|
|
) {
|
|
}
|
|
|
|
#[Auth]
|
|
#[Route('/login')]
|
|
public function __invoke(): ViewResult
|
|
{
|
|
return new ViewResult('loginform');
|
|
|
|
}
|
|
|
|
#[Auth]
|
|
#[Route('/login', Method::POST)]
|
|
public function login(LoginRequest $request): void
|
|
{
|
|
$login = new LoginUser($request->email, $request->password);
|
|
|
|
$this->commandBus->dispatch($login);
|
|
|
|
dd($request);
|
|
// TODO: Return proper response
|
|
|
|
}
|
|
}
|