implement logout use case
Green phase: Logout calls deleteByToken on SessionRepository. No-op for non-existent tokens.
This commit is contained in:
parent
ceb392fc8d
commit
58772d66c1
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