Skip to content

Commit

Permalink
added first part of wizard (authtype choosing)
Browse files Browse the repository at this point in the history
  • Loading branch information
NecronomiconCoding committed Jul 26, 2016
1 parent 269704b commit 12a1cf5
Showing 1 changed file with 33 additions and 4 deletions.
37 changes: 33 additions & 4 deletions PoGo.NecroBot.CLI/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,39 @@ namespace PoGo.NecroBot.CLI
{
internal class AuthSettings
{
public AuthType AuthType = AuthType.Google;
public string GoogleRefreshToken = "";
public string PtcUsername = "username2";
public string PtcPassword = "pw";
public AuthSettings()
{
if (File.Exists(Directory.GetCurrentDirectory() + "\\config\\auth.json")) return;
string type;
do
{
Console.WriteLine("Please choose your AuthType");
Console.WriteLine("(0) for Google Authentication");
Console.WriteLine("(1) for Pokemon Trainer Club");
type = Console.ReadLine();
} while (type != "1" && type != "0");
AuthType = type.Equals("0") ? AuthType.Google : AuthType.Ptc;
if (AuthType == AuthType.Google)
{
Console.Clear();
return;
}
do
{
Console.WriteLine("Username:");
PtcUsername = Console.ReadLine();
} while (string.IsNullOrEmpty(PtcUsername));
do
{
Console.WriteLine("Password:");
PtcPassword = Console.ReadLine();
} while (string.IsNullOrEmpty(PtcPassword));
Console.Clear();
}
public AuthType AuthType;
public string GoogleRefreshToken;
public string PtcUsername;
public string PtcPassword;


[JsonIgnore]
Expand Down

0 comments on commit 12a1cf5

Please sign in to comment.