Skip to content

Commit a4e2495

Browse files
committed
use sessionkey instead of password
Fixes #2167
1 parent c6267df commit a4e2495

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

octgnFX/Octgn.JodsEngine/SubscriptionModule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ internal void UpdateIsSubbed()
8989
bool? ret = null;
9090
try
9191
{
92-
if (string.IsNullOrWhiteSpace(Prefs.Password.Decrypt())) ret = false;
92+
if (string.IsNullOrWhiteSpace(Program.SessionKey)) ret = false;
9393
else
9494
{
9595
var client = new ApiClient();
96-
var res = client.IsSubbed(Prefs.Username, Prefs.Password.Decrypt());
96+
var res = client.IsSubbed(Prefs.Username, Program.SessionKey);
9797
switch (res)
9898
{
9999
case IsSubbedResult.Ok:

octgnFX/Octgn/Controls/HostGameSettings.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ Task<bool> StartLocalGame(DataNew.Entities.Game game, string name, string passwo
307307
async Task<bool> StartOnlineGame(DataNew.Entities.Game game, string name, string password)
308308
{
309309
var client = new Octgn.Site.Api.ApiClient();
310-
if (!await client.IsGameServerRunning(Prefs.Username, Prefs.Password.Decrypt()))
310+
if (!await client.IsGameServerRunning(Prefs.Username, Program.SessionKey))
311311
{
312312
throw new UserMessageException("The game server is currently down. Please try again later.");
313313
}

octgnFX/Octgn/Extentions/DeckExtensionMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public static string Share(this IDeck deck, string name)
2424
if (!Program.LobbyClient.IsConnected) throw new UserMessageException("You must be logged in to share a deck.");
2525
if (string.IsNullOrWhiteSpace(name)) throw new UserMessageException("The deck name can't be blank.");
2626
if (name.Length > 32) throw new UserMessageException("The deck name is too long.");
27-
var result = client.ShareDeck(Prefs.Username, Prefs.Password.Decrypt(), name, tempFile);
27+
var result = client.ShareDeck(Prefs.Username, Program.SessionKey, name, tempFile);
2828
if (result.Error)
2929
{
3030
throw new UserMessageException(result.Message);

octgnFX/Octgn/SubscriptionModule.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ internal void UpdateIsSubbed()
9595
if (Program.LobbyClient.IsConnected)
9696
{
9797
var client = new ApiClient();
98-
var res = client.IsSubbed(Prefs.Username, Prefs.Password.Decrypt());
98+
var res = client.IsSubbed(Prefs.Username, Program.SessionKey);
9999
switch (res)
100100
{
101101
case IsSubbedResult.Ok:
@@ -110,11 +110,11 @@ internal void UpdateIsSubbed()
110110
}
111111
else
112112
{
113-
if (string.IsNullOrWhiteSpace(Prefs.Password.Decrypt())) ret = false;
113+
if (string.IsNullOrWhiteSpace(Program.SessionKey)) ret = false;
114114
else
115115
{
116116
var client = new ApiClient();
117-
var res = client.IsSubbed(Prefs.Username, Prefs.Password.Decrypt());
117+
var res = client.IsSubbed(Prefs.Username, Program.SessionKey);
118118
switch (res)
119119
{
120120
case IsSubbedResult.Ok:

octgnFX/Octgn/Tabs/Play/PlayTab.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ private async Task<HostedGameViewModel> VerifyCanJoinGame(HostedGameViewModel ho
295295
if (hostedGame.GameSource == "Online") {
296296
var client = new ApiClient();
297297
try {
298-
if (!await client.IsGameServerRunning(Prefs.Username, Prefs.Password.Decrypt())) {
298+
if (!await client.IsGameServerRunning(Prefs.Username, Program.SessionKey)) {
299299
throw new UserMessageException("The game server is currently down. Please try again later.");
300300
}
301301
} catch (Exception ex) {

octgnFX/Octgn/Tabs/Profile/UserProfilePage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ private void ChangeIconClick(object sender, RoutedEventArgs e)
171171
var client = new Octgn.Site.Api.ApiClient();
172172
var res = client.SetUserIcon(
173173
Prefs.Username,
174-
Prefs.Password.Decrypt(),
174+
Program.SessionKey,
175175
"png",
176176
imgStream);
177177

0 commit comments

Comments
 (0)