Created
April 25, 2020 22:11
-
-
Save yuchung-chuang/f79c49b762e9443e84b0c795a0ac38c0 to your computer and use it in GitHub Desktop.
To see if a user is already signed in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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