chore: complete update
This commit is contained in:
38
src/Application/Auth/ShowLogin.php
Normal file
38
src/Application/Auth/ShowLogin.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
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()
|
||||
{
|
||||
return new ViewResult('loginform');
|
||||
|
||||
}
|
||||
|
||||
#[Auth]
|
||||
#[Route('/login', Method::POST)]
|
||||
public function login(LoginRequest $request)
|
||||
{
|
||||
$login = new LoginUser($request->email, $request->password);
|
||||
|
||||
$this->commandBus->dispatch($login);
|
||||
|
||||
dd($request);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user