Skip to content

Instantly share code, notes, and snippets.

@yuchung-chuang
Last active April 25, 2020 22:10
Show Gist options
  • Save yuchung-chuang/b47bcbfc1117f31cc06c3109fdbb3ae4 to your computer and use it in GitHub Desktop.
Save yuchung-chuang/b47bcbfc1117f31cc06c3109fdbb3ae4 to your computer and use it in GitHub Desktop.
AuthenticationManager.instance.getTokenInteractively(parentView: self) {
(token: String?, error: Error?) in
DispatchQueue.main.async {
guard let _ = token, error == nil else {
// Show the error and stay on the sign-in page
let alert = UIAlertController(title: "Error signing in",
message: error.debugDescription,
preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
self.present(alert, animated: true)
return
}
// Signed in successfully
// Go to welcome page
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment