about summary refs log tree commit diff
path: root/Utilities/LibMatrix.HomeserverEmulator/Controllers/AuthController.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-02-21 18:12:41 +0100
committerRory& <root@rory.gay>2025-02-21 18:12:41 +0100
commit4928d96d74d5bb559c83caeff33329fa629999dc (patch)
tree58ad9afb0dc836b557e339c2a3520b77e7eb0825 /Utilities/LibMatrix.HomeserverEmulator/Controllers/AuthController.cs
parentMxcUri class, other various work (diff)
downloadLibMatrix-4928d96d74d5bb559c83caeff33329fa629999dc.tar.xz
HomeserverEmulator changes
Diffstat (limited to '')
-rw-r--r--Utilities/LibMatrix.HomeserverEmulator/Controllers/AuthController.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/Utilities/LibMatrix.HomeserverEmulator/Controllers/AuthController.cs b/Utilities/LibMatrix.HomeserverEmulator/Controllers/AuthController.cs

index 4f10601..d0eaed4 100644 --- a/Utilities/LibMatrix.HomeserverEmulator/Controllers/AuthController.cs +++ b/Utilities/LibMatrix.HomeserverEmulator/Controllers/AuthController.cs
@@ -12,13 +12,10 @@ public class AuthController(ILogger<AuthController> logger, UserStore userStore, public async Task<LoginResponse> Login(LoginRequest request) { if (!request.Identifier.User.StartsWith('@')) request.Identifier.User = $"@{request.Identifier.User}:{tokenService.GenerateServerName(HttpContext)}"; - if (request.Identifier.User.EndsWith("localhost")) - request.Identifier.User = request.Identifier.User.Replace("localhost", tokenService.GenerateServerName(HttpContext)); + // if (request.Identifier.User.EndsWith("localhost")) + // request.Identifier.User = request.Identifier.User.Replace("localhost", tokenService.GenerateServerName(HttpContext)); - var user = await userStore.GetUserById(request.Identifier.User); - if (user is null) { - user = await userStore.CreateUser(request.Identifier.User); - } + var user = await userStore.GetUserById(request.Identifier.User) ?? await userStore.CreateUser(request.Identifier.User); return user.Login(); }