Skip to content

Instantly share code, notes, and snippets.

@delba
Last active September 18, 2016 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delba/17ce1f5cd6a894fe0d3b07c7f1694bd9 to your computer and use it in GitHub Desktop.
Save delba/17ce1f5cd6a894fe0d3b07c7f1694bd9 to your computer and use it in GitHub Desktop.
let google: Provider = .google(clientID: "", clientSecret: "")
google.scopes = ["email", "profile"]
google.authorize(getCode: { code, url in
// prompt user to visit url and enter code
}) { result in
switch result {
case .success(let token):
print(token)
case .failure(let error):
print(error)
}
}
@fabiomassimo
Copy link

I'm afraid that 'getCode' is not enough to communicate to the client that he is kicking off a device authentication flow and not just "a" code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment