diff --git a/extra/admin-api/Utilities/Spacebar.Sdk/Core/SpacebarClient.cs b/extra/admin-api/Utilities/Spacebar.Sdk/Core/SpacebarClient.cs index 976dda1e6..b4d8bc950 100644 --- a/extra/admin-api/Utilities/Spacebar.Sdk/Core/SpacebarClient.cs +++ b/extra/admin-api/Utilities/Spacebar.Sdk/Core/SpacebarClient.cs @@ -81,6 +81,12 @@ public class AuthenticatedSpacebarClient { if (!resp.IsSuccessStatusCode) throw SpacebarApiException.FromJson((await resp.Content.ReadFromJsonAsync())!); return (await resp.Content.ReadFromJsonAsync>())!; } + + public async Task LogOutAsync() + { + var resp = await ApiHttpClient.PostAsJsonAsync("auth/logout", new {}); + if (!resp.IsSuccessStatusCode) throw SpacebarApiException.FromJson((await resp.Content.ReadFromJsonAsync())!); + } } public class SpacebarClientChannel(AuthenticatedSpacebarClient client, long channelId) { @@ -204,7 +210,7 @@ public class AuthenticatedSpacebarGatewayClient(ILogger()!.HeartbeatInterval, _cts.Token).ContinueWith(ct => { - logger.LogWarning("Heartbeat loop exited!"); + logger.LogWarning("Heartbeat loop exited! ({code}: {reason})", RawClientWebSocket.CloseStatus, RawClientWebSocket.CloseStatusDescription); if (ct.IsFaulted) throw ct.Exception; }); IdentifyData.Token = token;