diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2025-08-13 21:50:27 +0200 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2025-08-13 21:50:27 +0200 |
| commit | 3f4b51b99a4f4dc41dbdce7f34afe7e15d3d426e (patch) | |
| tree | eed0848f59e70aac075ba09bbb1b6e52a62a681f /src/Controllers/LoginController.php | |
| parent | beb68ad3ddc48f9e913815e0e18f11965201f32e (diff) | |
get login types route and various
Diffstat (limited to 'src/Controllers/LoginController.php')
| -rw-r--r-- | src/Controllers/LoginController.php | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Controllers/LoginController.php b/src/Controllers/LoginController.php new file mode 100644 index 0000000..f5ca3be --- /dev/null +++ b/src/Controllers/LoginController.php @@ -0,0 +1,35 @@ +<?php + +namespace App\Controllers; + +use App\Types\LoginFlow; +use App\Types\LoginType; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\JsonResponse; + +class LoginController +{ + public function supportedLoginTypes(): Response + { + return new JsonResponse([ + "flows" => [ + (new LoginFlow(LoginType::PASSWORD))->toArray(), + ], + ]); + } + + public function login(): Response + { + $request = Request::createFromGlobals(); + + return new JsonResponse([ + "access_token" => "abc123", + "device_id" => "ABC", + "expires_in_ms" => 60000, + "refresh_token" => "def456", + "user_id" => "@php:localhost", + #"well_known" => [], + ]); + } +} |
