diff options
| author | Daniel Weipert <git@mail.dweipert.de> | 2026-03-05 14:57:28 +0100 |
|---|---|---|
| committer | Daniel Weipert <git@mail.dweipert.de> | 2026-03-05 14:57:28 +0100 |
| commit | bd11271621bd3759cfd194ed0119c0dc28155fd0 (patch) | |
| tree | 319b4790d4e2b05513abf023732ed6fb0717f603 /src/Controllers/LoginController.php | |
| parent | 2386148b8f048ba40d9f26cc97898bdcdc778ea2 (diff) | |
Diffstat (limited to 'src/Controllers/LoginController.php')
| -rw-r--r-- | src/Controllers/LoginController.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Controllers/LoginController.php b/src/Controllers/LoginController.php index c520e25..9ae3a48 100644 --- a/src/Controllers/LoginController.php +++ b/src/Controllers/LoginController.php @@ -9,10 +9,12 @@ use App\Errors\UnknownError; use App\Models\Device; use App\Models\Tokens; use App\Models\User; +use App\Support\Logger; +use App\Support\Parser; use App\Support\RequestValidator; -use App\Types\UserRegistrationKind; use Matrix\Data\LoginFlow; use Matrix\Enums\LoginType; +use Matrix\Enums\UserRegistrationKind; use Matrix\Responses\ClientLoginGetResponse; use Matrix\Responses\ClientLoginPostResponse; use Matrix\Responses\ClientRegisterPostResponse; @@ -37,6 +39,8 @@ class LoginController */ public function login(Request $request): Response { + Logger::logRequestToFile($request); + $body = json_decode($request->getContent(), true); RequestValidator::validateJson(); @@ -49,7 +53,11 @@ class LoginController } // get user id - $userId = $body["identifier"]["user"]; + $userId = Parser::parseUser($body["identifier"]["user"]); + if (empty($userId["server"])) { + #$userId = "@$userId[username]:$_ENV[DOMAIN]"; + $userId = "@$userId[username]:localhost"; + } #if ($loginType == LoginType::PASSWORD) {} |
