Unknown reason for error "ASWebAuthenticationSessionError.Code.presentationContextInvalid"

I have been unable to determine the cause of the error ASWebAuthenticationSessionError.Code.presentationContextInvalid for a little while now. I followed the example provided here with no luck.

I am setting the delegate in my session here:

if #available(iOS 13.0, *) {
   self.presentationController = viewController
   currentAuthenticationSession?.presentationContextProvider = self
}

and then further down I have the code:

func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
   presentationController?.view.window ?? ASPresentationAnchor()
}

Is there something blatantly obvious I am missing here?

Terms of Service

Privacy Policy

Cookie Policy