Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save SergeyPetrachkov/ef5c1f6f43b8304c1805ed850315620c to your computer and use it in GitHub Desktop.

Select an option

Save SergeyPetrachkov/ef5c1f6f43b8304c1805ed850315620c to your computer and use it in GitHub Desktop.
didCompleteWithAuthorization
func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
switch authorization.credential {
case let appleIDCredential as ASAuthorizationAppleIDCredential:
if let identityToken = appleIDCredential.identityToken,
let token = String(data: identityToken, encoding: .utf8),
let decodedToken = try? decode(jwt: token) {
// do your thing here
} else {
// something went wrong, handle it
}
default:
//
break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment