This commit is contained in:
Torsten 2024-11-29 10:06:42 +01:00
parent afe2245110
commit d69b379f97
4 changed files with 158 additions and 0 deletions

View file

@ -0,0 +1,21 @@
https://www.youtube.com/watch?v=H1KiXEsmsCs&list=PLT9miexWCpPW6Z_OXNv2d78cqCrZaPrVG&index=34
Routes.php:
```php
//Get
$routes->get("logout", "AuthController::logout", ["filter" => "apiauth"]);
```
AuthController.php
```php
public function logout() {
auth()->logout();
auth()->user()->revokeAllAccessTokens();
return $this->respondCreated([
"status" => true,
"message" => "User logged out successfully",
"data" => []
]);
}
```