-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
237 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System.Threading.Tasks; | ||
using Spectre.Console; | ||
using SteamKit2.Authentication; | ||
|
||
namespace SteamTokenDumper; | ||
|
||
internal class ConsoleAuthenticator : IAuthenticator | ||
Check warning on line 7 in ConsoleAuthenticator.cs GitHub Actions / ubuntu-latest
Check warning on line 7 in ConsoleAuthenticator.cs GitHub Actions / windows-latest
|
||
{ | ||
/// <inheritdoc /> | ||
public Task<string> GetDeviceCodeAsync(bool previousCodeWasIncorrect) | ||
{ | ||
if (previousCodeWasIncorrect) | ||
{ | ||
AnsiConsole.MarkupLine("[red]The previous two-factor auth code you have provided is incorrect.[/]"); | ||
} | ||
|
||
var code = AnsiConsole.Ask<string>("[green][bold]STEAM GUARD![/][/] Enter your two-factor code from your authenticator app:").Trim(); | ||
|
||
return Task.FromResult(code); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public Task<string> GetEmailCodeAsync(string email, bool previousCodeWasIncorrect) | ||
{ | ||
if (previousCodeWasIncorrect) | ||
{ | ||
AnsiConsole.MarkupLine("[red]The previous two-factor auth code you have provided is incorrect.[/]"); | ||
} | ||
|
||
var code = AnsiConsole.Ask<string>($"[green][bold]STEAM GUARD![/][/] Please enter the auth code sent to the email at {Markup.Escape(email)}:").Trim(); | ||
|
||
return Task.FromResult(code); | ||
} | ||
|
||
/// <inheritdoc /> | ||
public Task<bool> AcceptDeviceConfirmationAsync() | ||
{ | ||
AnsiConsole.MarkupLine("[green][bold]STEAM GUARD![/][/] Use the Steam Mobile App to confirm your sign in..."); | ||
|
||
return Task.FromResult(true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using Spectre.Console; | ||
using Spectre.Console.Rendering; | ||
|
||
namespace SteamTokenDumper; | ||
|
||
internal class IntValueProgressColumn : ProgressColumn | ||
Check warning on line 7 in IntValueProgressColumn.cs GitHub Actions / ubuntu-latest
Check warning on line 7 in IntValueProgressColumn.cs GitHub Actions / windows-latest
|
||
{ | ||
/// <inheritdoc/> | ||
public override IRenderable Render(RenderOptions options, ProgressTask task, TimeSpan deltaTime) | ||
{ | ||
var total = (int)task.MaxValue; | ||
|
||
if (task.IsFinished) | ||
{ | ||
return new Markup($"[green]{total}[/] ").RightJustified(); | ||
} | ||
|
||
var current = (int)task.Value; | ||
|
||
return new Markup($"[green]{current}[/][grey]/{total}[/] ").RightJustified(); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public override int? GetColumnWidth(RenderOptions options) | ||
{ | ||
return 16; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.