Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Jan 29, 2024
1 parent 119caeb commit 608bece
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ internal sealed class SteamTokenDumperPlugin : OfficialPlugin, IASF, IBot, IBotC
}

if (response.Content.Data == null) {
ASF.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, ArchiSteamFarm.Localization.Strings.ErrorIsInvalid), nameof(response.Content.Data));
ASF.ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, ArchiSteamFarm.Localization.Strings.ErrorIsInvalid, nameof(response.Content.Data)));

return;
}
Expand Down
13 changes: 11 additions & 2 deletions ArchiSteamFarm/Steam/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,22 @@ public sealed class Bot : IAsyncDisposable, IDisposable {

private set {
AccessTokenValidUntil = null;
BackingAccessToken = value;

if (string.IsNullOrEmpty(value)) {
BackingAccessToken = null;

return;
}

if (!Utilities.TryReadJwtToken(value, out JwtSecurityToken? accessToken)) {
ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(accessToken)));

return;
}

if (Utilities.TryReadJwtToken(value, out JwtSecurityToken? accessToken) && (accessToken.ValidTo > DateTime.MinValue)) {
BackingAccessToken = value;

if (accessToken.ValidTo > DateTime.MinValue) {
AccessTokenValidUntil = accessToken.ValidTo;
}
}
Expand Down

0 comments on commit 608bece

Please sign in to comment.