Skip to content

Instantly share code, notes, and snippets.

@yuchung-chuang
Created April 25, 2020 22:11
Show Gist options
  • Save yuchung-chuang/f79c49b762e9443e84b0c795a0ac38c0 to your computer and use it in GitHub Desktop.
Save yuchung-chuang/f79c49b762e9443e84b0c795a0ac38c0 to your computer and use it in GitHub Desktop.
To see if a user is already signed in
AuthenticationManager.instance.getTokenSilently {
(token: String?, error: Error?) in
DispatchQueue.main.async {
guard let _ = token, error == nil else {
// If there is no token or if there's an error,
// no user is signed in, so stay here
return
}
// Since we got a token, a user is signed in
// Go to welcome page
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment