mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-26 06:41:45 +00:00
f15632f2d0
- Introduced centralized MAACRequestHandler for error tracking, retries, and status escalation (Ok/Warning/Error) per account - PortableMaClient now uses new Status property (PortableMaClientStatus) instead of IsError; error history tracked in PortableMaClientErrorData - All MAAC requests now routed through MAACRequestHandler, providing unified error handling and retry logic - MultiAccountAutoConfirmer now filters accounts by Status.StatusType == Ok - Updated MainWindow UI: account name color reflects status (Success/Warning/Error); added "Unattach proxy" to context menu - Removed obsolete PortableMaClientStatusToColorConverter and related bindings - Settings: removed IgnorePatchTuesdayErrors, added MaacErrorThreshold and MaacRetryInterval for error escalation control - Refactored SessionHandler: split into logic, API, and helpers; improved exception propagation and session management - AdmissionHelper methods now handle null sessions and always transfer community cookies if session is missing - Mafile export: always preserves SteamId, even if session data is not exported - ViewModel: RemoveProxy command now parameterized and only enabled if Mafile has a proxy - Enabled concurrent log writing in NLog config - Minor code cleanups and improved exception signatures
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
using NebulaAuth.Model.Entities;
|
|
|
|
namespace NebulaAuth.Model;
|
|
|
|
public partial class SessionHandler //Helpers
|
|
{
|
|
private static bool MobileTokenExpired(this Mafile mafile)
|
|
{
|
|
var mobileToken = mafile.SessionData?.GetMobileToken();
|
|
return mobileToken == null || mobileToken.Value.IsExpired;
|
|
}
|
|
|
|
private static bool RefreshTokenExpired(this Mafile mafile)
|
|
{
|
|
var refreshToken = mafile.SessionData?.RefreshToken;
|
|
return refreshToken == null || refreshToken.Value.IsExpired;
|
|
}
|
|
|
|
private static bool HasPassword(this Mafile mafile, [NotNullWhen(true)] out string? plainPassword)
|
|
{
|
|
plainPassword = GetPassword(mafile);
|
|
return !string.IsNullOrWhiteSpace(plainPassword);
|
|
}
|
|
|
|
private static string? GetPassword(Mafile mafile)
|
|
{
|
|
try
|
|
{
|
|
if (PHandler.IsPasswordSet && !string.IsNullOrWhiteSpace(mafile.Password))
|
|
{
|
|
return PHandler.Decrypt(mafile.Password);
|
|
}
|
|
}
|
|
catch
|
|
{
|
|
// ignored
|
|
}
|
|
|
|
return null;
|
|
}
|
|
} |