From 4928d96d74d5bb559c83caeff33329fa629999dc Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 21 Feb 2025 18:12:41 +0100 Subject: HomeserverEmulator changes --- .../LibMatrix.HomeserverEmulator/Controllers/AuthController.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Utilities/LibMatrix.HomeserverEmulator/Controllers/AuthController.cs') 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 logger, UserStore userStore, public async Task 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(); } -- cgit 1.5.1