diff options
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" => [], + ]); + } +} |
