implement Logout use case
thin pass-through to SessionRepository->deleteByToken. test green; 33 tests pass.
This commit is contained in:
parent
30e97864c8
commit
526a1b8f61
1 changed files with 17 additions and 0 deletions
17
backend/app/Auth/UseCases/Logout/Logout.php
Normal file
17
backend/app/Auth/UseCases/Logout/Logout.php
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Auth\UseCases\Logout;
|
||||||
|
|
||||||
|
use App\Auth\SessionRepository;
|
||||||
|
|
||||||
|
class Logout
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private SessionRepository $sessionRepo,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public function execute(string $token): void
|
||||||
|
{
|
||||||
|
$this->sessionRepo->deleteByToken($token);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue