Compare commits
41 Commits
DepotDownl
...
master
Author | SHA1 | Date |
---|---|---|
|
54b0af377b | 2 weeks ago |
|
5164a9f963 | 2 weeks ago |
|
2d2113a8e9 | 2 weeks ago |
|
5d6950afd9 | 3 months ago |
|
b042b055c4 | 3 months ago |
|
02a525acdb | 3 months ago |
|
c553ef4d60 | 4 months ago |
|
9e203e0d7c | 5 months ago |
|
76038d83e8 | 5 months ago |
|
c21489d304 | 5 months ago |
|
0d37091adf | 5 months ago |
|
0d66cf09ac | 5 months ago |
|
8d875579c5 | 5 months ago |
|
ff9c709787 | 5 months ago |
|
bce88e4d32 | 5 months ago |
|
08542bd09f | 5 months ago |
|
665f83983b | 5 months ago |
|
272f5b646a | 5 months ago |
|
f078581947 | 5 months ago |
|
4896ac0788 | 6 months ago |
|
401d086191 | 6 months ago |
|
8d8c6fc59a | 6 months ago |
|
19df5910c3 | 6 months ago |
|
1e72a47846 | 6 months ago |
|
2c07abb015 | 6 months ago |
|
2682d44684 | 6 months ago |
|
be3682cd4b | 6 months ago |
|
644e3f1ebc | 6 months ago |
|
56822a831f | 6 months ago |
|
001f5303a7 | 6 months ago |
|
0150b7eff4 | 6 months ago |
|
14c6a6dafa | 6 months ago |
|
0617974ac0 | 7 months ago |
|
3249d284ba | 7 months ago |
|
7b3cf4c6c7 | 8 months ago |
|
b6fc6d5c6f | 8 months ago |
|
4dbe7ede14 | 8 months ago |
|
24d7f0b02a | 8 months ago |
|
3bd2cf52ba | 8 months ago |
|
f660b95d3f | 8 months ago |
|
17d3996588 | 9 months ago |
@ -0,0 +1,76 @@
|
||||
// This file is subject to the terms and conditions defined
|
||||
// in file 'LICENSE', which is part of this source code package.
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using SteamKit2.Authentication;
|
||||
|
||||
namespace DepotDownloader
|
||||
{
|
||||
// This is practically copied from https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Steam/Authentication/UserConsoleAuthenticator.cs
|
||||
internal class ConsoleAuthenticator : IAuthenticator
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<string> GetDeviceCodeAsync(bool previousCodeWasIncorrect)
|
||||
{
|
||||
if (previousCodeWasIncorrect)
|
||||
{
|
||||
Console.Error.WriteLine("The previous 2-factor auth code you have provided is incorrect.");
|
||||
}
|
||||
|
||||
string code;
|
||||
|
||||
do
|
||||
{
|
||||
Console.Error.Write("STEAM GUARD! Please enter your 2-factor auth code from your authenticator app: ");
|
||||
code = Console.ReadLine()?.Trim();
|
||||
|
||||
if (code == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (string.IsNullOrEmpty(code));
|
||||
|
||||
return Task.FromResult(code!);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<string> GetEmailCodeAsync(string email, bool previousCodeWasIncorrect)
|
||||
{
|
||||
if (previousCodeWasIncorrect)
|
||||
{
|
||||
Console.Error.WriteLine("The previous 2-factor auth code you have provided is incorrect.");
|
||||
}
|
||||
|
||||
string code;
|
||||
|
||||
do
|
||||
{
|
||||
Console.Error.Write($"STEAM GUARD! Please enter the auth code sent to the email at {email}: ");
|
||||
code = Console.ReadLine()?.Trim();
|
||||
|
||||
if (code == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (string.IsNullOrEmpty(code));
|
||||
|
||||
return Task.FromResult(code!);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<bool> AcceptDeviceConfirmationAsync()
|
||||
{
|
||||
if (ContentDownloader.Config.SkipAppConfirmation)
|
||||
{
|
||||
return Task.FromResult(false);
|
||||
}
|
||||
|
||||
Console.Error.WriteLine("STEAM GUARD! Use the Steam Mobile App to confirm your sign in...");
|
||||
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue