diff options
author | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-28 10:38:45 +0200 |
---|---|---|
committer | TheArcaneBrony <myrainbowdash949@gmail.com> | 2023-06-28 10:38:45 +0200 |
commit | a331eb2f118e0051c6c6744a20d6b0934c4d6d6f (patch) | |
tree | a7798d94a3553106aad40507e2dc04ff9d2f9efd /MatrixRoomUtils.Core/Authentication/MatrixAuth.cs | |
parent | Dependency injection stuff (diff) | |
download | MatrixUtils-a331eb2f118e0051c6c6744a20d6b0934c4d6d6f.tar.xz |
Update stuff
Diffstat (limited to 'MatrixRoomUtils.Core/Authentication/MatrixAuth.cs')
-rw-r--r-- | MatrixRoomUtils.Core/Authentication/MatrixAuth.cs | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/MatrixRoomUtils.Core/Authentication/MatrixAuth.cs b/MatrixRoomUtils.Core/Authentication/MatrixAuth.cs index b1b0362..28e0c49 100644 --- a/MatrixRoomUtils.Core/Authentication/MatrixAuth.cs +++ b/MatrixRoomUtils.Core/Authentication/MatrixAuth.cs @@ -7,9 +7,10 @@ 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<LoginResponse> Login(string homeserver, string username, string password) { Console.WriteLine($"Logging in to {homeserver} as {username}..."); - homeserver = (await new RemoteHomeServer(homeserver).Configure()).FullHomeServerDomain; + homeserver = (new RemoteHomeServer(homeserver)).FullHomeServerDomain; var hc = new MatrixHttpClient(); var payload = new { type = "m.login.password", @@ -31,20 +32,4 @@ public class MatrixAuth { //var token = data.GetProperty("access_token").GetString(); //return token; } - - [Obsolete("Migrate to IHomeServer instance")] - public static async Task<ProfileResponse> GetProfile(string homeserver, string mxid) => await (await new RemoteHomeServer(homeserver).Configure()).GetProfile(mxid); - - private static async Task<bool> CheckSuccessStatus(string url) { - //cors causes failure, try to catch - try { - using var hc = new HttpClient(); - var resp = await hc.GetAsync(url); - return resp.IsSuccessStatusCode; - } - catch (Exception e) { - Console.WriteLine($"Failed to check success status: {e.Message}"); - return false; - } - } } \ No newline at end of file |