add multi chracter key checks

This commit is contained in:
Stanley Dimant
2024-07-19 11:45:38 +02:00
committed by Loporrit
parent d9d10c42de
commit 0228c2343b
7 changed files with 35 additions and 16 deletions

View File

@@ -64,7 +64,7 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
tokenUri = MareAuth.AuthFullPath(new Uri(_serverManager.CurrentApiUrl
.Replace("wss://", "https://", StringComparison.OrdinalIgnoreCase)
.Replace("ws://", "http://", StringComparison.OrdinalIgnoreCase)));
var secretKey = _serverManager.GetSecretKey()!;
var secretKey = _serverManager.GetSecretKey(out _)!;
var auth = secretKey.GetHash256();
result = await _httpClient.PostAsync(tokenUri, new FormUrlEncodedContent(new[]
{
@@ -103,7 +103,7 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
{
jwtIdentifier = new(_serverManager.CurrentApiUrl,
_dalamudUtil.GetPlayerNameHashedAsync().GetAwaiter().GetResult(),
_serverManager.GetSecretKey()!);
_serverManager.GetSecretKey(out _)!);
_lastJwtIdentifier = jwtIdentifier;
}
catch (Exception ex)