Skip to content

Commit c545304

Browse files
committed
Add LoginSkipAppConfirmation
1 parent 420fc2f commit c545304

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

Configuration.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace SteamTokenDumper;
1010
internal sealed class Configuration
1111
{
1212
public bool RememberLogin { get; private set; }
13+
public bool LoginSkipAppConfirmation { get; private set; }
1314
public bool SkipAutoGrant { get; private set; }
1415
public bool VerifyBeforeSubmit { get; private set; } = true;
1516
public bool UserConsentBeforeRun { get; private set; } = true;
@@ -41,6 +42,9 @@ public async Task Load()
4142
case "RememberLogin":
4243
RememberLogin = option[1] == "1";
4344
break;
45+
case "LoginSkipAppConfirmation":
46+
LoginSkipAppConfirmation = option[1] == "1";
47+
break;
4448
case "SkipAutoGrant":
4549
SkipAutoGrant = option[1] == "1";
4650
break;

ConsoleAuthenticator.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace SteamTokenDumper;
66

7-
internal sealed class ConsoleAuthenticator : IAuthenticator
7+
internal sealed class ConsoleAuthenticator(bool SkipDeviceConfirmation) : IAuthenticator
88
{
99
/// <inheritdoc />
1010
public async Task<string> GetDeviceCodeAsync(bool previousCodeWasIncorrect)
@@ -35,6 +35,11 @@ public async Task<string> GetEmailCodeAsync(string email, bool previousCodeWasIn
3535
/// <inheritdoc />
3636
public Task<bool> AcceptDeviceConfirmationAsync()
3737
{
38+
if (SkipDeviceConfirmation)
39+
{
40+
return Task.FromResult(false);
41+
}
42+
3843
AnsiConsole.MarkupLine("[green][bold]STEAM GUARD![/][/] Use the Steam Mobile App to confirm your sign in...");
3944

4045
return Task.FromResult(true);

Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ private static async void OnConnected(SteamClient.ConnectedCallback callback)
387387
Username = savedCredentials.Username,
388388
IsPersistentSession = Configuration.RememberLogin,
389389
DeviceFriendlyName = nameof(SteamTokenDumper),
390-
Authenticator = new ConsoleAuthenticator(),
390+
Authenticator = new ConsoleAuthenticator(Configuration.LoginSkipAppConfirmation),
391391
});
392392
}
393393
}

SteamTokenDumper.config.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
; This saves a "login key" (same as how Steam remembers your login), your password is not stored
99
RememberLogin = 0
1010

11+
; Set this to 1 if you wish to enter two-factor code instead of confirming login in the Steam mobile app
12+
LoginSkipAppConfirmation = 0
13+
1114
; Set this to 1 if you wish to skip auto granted developer packages
1215
; This option also disables reading cached tokens from Steam client files
1316
; You only need to use this if you are a game developer and do not want SteamDB to get info about your games

0 commit comments

Comments
 (0)