pollForSession abstract method

Future<AuthenticationResponse> pollForSession({
  1. required String pendingRef,
  2. Duration? timeout,
})

Waits until an enchanted link authentication has been verified by the user.

Provide this function with a pendingRef received by signUp, signIn, signUpOrIn or updateEmail. This function will only return an AuthenticationResponse successfully after the user presses the enchanted link in the authentication email.

This function calls checkForSession periodically until the authentication is verified. It will keep polling even if it encounters network errors, but any other unexpected errors will be rethrown. If the timeout expires a DescopeError.enchantedLinkExpired error is thrown. timeout is an optional duration to poll for until giving up. If not given a default value of 2 minutes is used.

To cancel it, you can wrap the response in a CancelableOperation.

Implementation

Future<AuthenticationResponse> pollForSession({required String pendingRef, Duration? timeout});