Skip to content

Commit

Permalink
Reworked authentication.
Browse files Browse the repository at this point in the history
  • Loading branch information
NTDLS committed Jun 12, 2024
1 parent 2c1919c commit f9da8d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
10 changes: 8 additions & 2 deletions NetProxy.Client/Classes/MessageClientFactory.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NetProxy.Library.Payloads.ReliableMessages.Notifications;
using NetProxy.Library.Payloads.ReliableMessages.Queries;
using NetProxy.Library.Utilities;
using NTDLS.ReliableMessaging;

Expand All @@ -12,7 +12,13 @@ public static class MessageClientFactory
{
var client = new RmClient();
client.Connect(connectionInfo.ServerName, connectionInfo.Port);
client.Notify(new NotificationRegisterLogin(connectionInfo.UserName, NpUtility.Sha256(connectionInfo.Password)));

var loginResult = client.Query(new QueryLogin(connectionInfo.UserName, NpUtility.Sha256(connectionInfo.Password))).Result;
if (loginResult.Result != true)
{
throw new Exception("Login failed.");
}

return client;
}
catch { }
Expand Down

This file was deleted.

0 comments on commit f9da8d6

Please sign in to comment.