diff options
author | Emma [it/its]@Rory& <root@rory.gay> | 2024-04-05 18:58:32 +0200 |
---|---|---|
committer | Emma [it/its]@Rory& <root@rory.gay> | 2024-04-05 18:58:32 +0200 |
commit | 37b97d65c0a5262539a5de560e911048166b8bba (patch) | |
tree | f704a9c703b0ec47122a460576e151e0cb06fdc6 /Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomsController.cs | |
parent | Fix merge conficts between machines (diff) | |
download | LibMatrix-37b97d65c0a5262539a5de560e911048166b8bba.tar.xz |
Fix homeserver resolution, rewrite homeserver initialisation, HSE work
Diffstat (limited to 'Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomsController.cs')
-rw-r--r-- | Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomsController.cs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomsController.cs b/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomsController.cs index b0f5014..6849ff8 100644 --- a/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomsController.cs +++ b/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomsController.cs @@ -14,7 +14,7 @@ public class RoomsController(ILogger<RoomsController> logger, TokenService token //createRoom [HttpPost("createRoom")] public async Task<RoomIdResponse> CreateRoom([FromBody] CreateRoomRequest request) { - var token = tokenService.GetAccessToken(HttpContext); + var token = tokenService.GetAccessTokenOrNull(HttpContext); if (token == null) throw new MatrixException() { ErrorCode = "M_MISSING_TOKEN", @@ -71,7 +71,7 @@ public class RoomsController(ILogger<RoomsController> logger, TokenService token [HttpPost("rooms/{roomId}/upgrade")] public async Task<object> UpgradeRoom(string roomId, [FromBody] UpgradeRoomRequest request) { - var token = tokenService.GetAccessToken(HttpContext); + var token = tokenService.GetAccessTokenOrNull(HttpContext); if (token == null) throw new MatrixException() { ErrorCode = "M_MISSING_TOKEN", @@ -125,7 +125,7 @@ public class RoomsController(ILogger<RoomsController> logger, TokenService token [HttpPost("rooms/{roomId}/leave")] // TODO: implement public async Task<object> LeaveRoom(string roomId) { - var token = tokenService.GetAccessToken(HttpContext); + var token = tokenService.GetAccessTokenOrNull(HttpContext); if (token == null) throw new MatrixException() { ErrorCode = "M_MISSING_TOKEN", |