Skip to content

Commit

Permalink
Merged in async_auth (pull request #3)
Browse files Browse the repository at this point in the history
Cli: Execute Authenticate command async
  • Loading branch information
tuxuser committed Mar 29, 2020
2 parents 083f0d8 + 7b87d53 commit d6c6b2e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions SmartGlass.Cli/AuthenticateCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ internal class AuthenticateCommand : Command
[PositionalArgument(ArgumentFlags.Required, Position = 0)]
public string TokenFilePath { get; set; }

#pragma warning disable 1998
public override async Task<CommandResult> ExecuteAsync(CancellationToken cancel)
{
string authUrl = AuthenticationService.GetWindowsLiveAuthenticationUrl();
Expand All @@ -34,7 +33,7 @@ public override async Task<CommandResult> ExecuteAsync(CancellationToken cancel)

AuthenticationService authService = new AuthenticationService(response);

authService.Authenticate();
await authService.AuthenticateAsync();

using (FileStream fs = File.Open(TokenFilePath, FileMode.Create))
{
Expand All @@ -50,6 +49,5 @@ public override async Task<CommandResult> ExecuteAsync(CancellationToken cancel)
Console.WriteLine($"Authentication succeeded, tokens saved to {TokenFilePath}");
return CommandResult.Success;
}
#pragma warning restore 1998
}
}

0 comments on commit d6c6b2e

Please sign in to comment.