From bb8c2637af3b7982e7a4b2fd15e2fbec613d0848 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Fri, 30 Jun 2023 03:36:58 +0200 Subject: Todays progress --- MatrixRoomUtils.Core/Authentication/MatrixAuth.cs | 35 ----------------------- 1 file changed, 35 deletions(-) delete mode 100644 MatrixRoomUtils.Core/Authentication/MatrixAuth.cs (limited to 'MatrixRoomUtils.Core/Authentication') diff --git a/MatrixRoomUtils.Core/Authentication/MatrixAuth.cs b/MatrixRoomUtils.Core/Authentication/MatrixAuth.cs deleted file mode 100644 index 28e0c49..0000000 --- a/MatrixRoomUtils.Core/Authentication/MatrixAuth.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Net.Http.Json; -using System.Text.Json; -using MatrixRoomUtils.Core.Extensions; -using MatrixRoomUtils.Core.Responses; -using MatrixRoomUtils.Core.StateEventTypes; - -namespace MatrixRoomUtils.Core.Authentication; - -public class MatrixAuth { - [Obsolete("This is possibly broken and should not be used.", true)] - public static async Task Login(string homeserver, string username, string password) { - Console.WriteLine($"Logging in to {homeserver} as {username}..."); - homeserver = (new RemoteHomeServer(homeserver)).FullHomeServerDomain; - var hc = new MatrixHttpClient(); - var payload = new { - type = "m.login.password", - identifier = new { - type = "m.id.user", - user = username - }, - password, - initial_device_display_name = "Rory&::MatrixRoomUtils" - }; - Console.WriteLine($"Sending login request to {homeserver}..."); - var resp = await hc.PostAsJsonAsync($"{homeserver}/_matrix/client/v3/login", payload); - Console.WriteLine($"Login: {resp.StatusCode}"); - var data = await resp.Content.ReadFromJsonAsync(); - if (!resp.IsSuccessStatusCode) Console.WriteLine("Login: " + data); - - Console.WriteLine($"Login: {data.ToJson()}"); - return data.Deserialize(); - //var token = data.GetProperty("access_token").GetString(); - //return token; - } -} \ No newline at end of file -- cgit 1.5.1