about summary refs log tree commit diff
path: root/Tests/LibMatrix.HomeserverEmulator/Controllers/Users/UserController.cs
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2024-04-05 18:58:32 +0200
committerEmma [it/its]@Rory& <root@rory.gay>2024-04-05 18:58:32 +0200
commit37b97d65c0a5262539a5de560e911048166b8bba (patch)
treef704a9c703b0ec47122a460576e151e0cb06fdc6 /Tests/LibMatrix.HomeserverEmulator/Controllers/Users/UserController.cs
parentFix merge conficts between machines (diff)
downloadLibMatrix-37b97d65c0a5262539a5de560e911048166b8bba.tar.xz
Fix homeserver resolution, rewrite homeserver initialisation, HSE work
Diffstat (limited to 'Tests/LibMatrix.HomeserverEmulator/Controllers/Users/UserController.cs')
-rw-r--r--Tests/LibMatrix.HomeserverEmulator/Controllers/Users/UserController.cs18
1 files changed, 0 insertions, 18 deletions
diff --git a/Tests/LibMatrix.HomeserverEmulator/Controllers/Users/UserController.cs b/Tests/LibMatrix.HomeserverEmulator/Controllers/Users/UserController.cs
index e886d46..2be3896 100644
--- a/Tests/LibMatrix.HomeserverEmulator/Controllers/Users/UserController.cs
+++ b/Tests/LibMatrix.HomeserverEmulator/Controllers/Users/UserController.cs
@@ -15,12 +15,6 @@ public class UserController(ILogger<UserController> logger, TokenService tokenSe
     [HttpGet("account/whoami")]

     public async Task<WhoAmIResponse> Login() {

         var token = tokenService.GetAccessToken(HttpContext);

-        if (token is null)

-            throw new MatrixException() {

-                ErrorCode = "M_UNAUTHORIZED",

-                Error = "No token passed."

-            };

-

         var user = await userStore.GetUserByToken(token, Random.Shared.Next(101) <= 10, tokenService.GenerateServerName(HttpContext));

         if (user is null)

             throw new MatrixException() {

@@ -36,12 +30,6 @@ public class UserController(ILogger<UserController> logger, TokenService tokenSe
     [HttpGet("joined_rooms")]

     public async Task<object> GetJoinedRooms() {

         var token = tokenService.GetAccessToken(HttpContext);

-        if (token is null)

-            throw new MatrixException() {

-                ErrorCode = "M_UNAUTHORIZED",

-                Error = "No token passed."

-            };

-

         var user = await userStore.GetUserByToken(token, false);

         if (user is null)

             throw new MatrixException() {

@@ -60,12 +48,6 @@ public class UserController(ILogger<UserController> logger, TokenService tokenSe
     [HttpGet("devices")]

     public async Task<DevicesResponse> GetDevices() {

         var token = tokenService.GetAccessToken(HttpContext);

-        if (token is null)

-            throw new MatrixException() {

-                ErrorCode = "M_UNAUTHORIZED",

-                Error = "No token passed."

-            };

-

         var user = await userStore.GetUserByToken(token, false);

         if (user is null)

             throw new MatrixException() {