handleRedirectFuture method

Future<AuthenticationResult?> handleRedirectFuture([
  1. String? hash
])

Event handler function which allows users to fire events after the PublicClientApplication object has loaded during redirect flows.

This should be invoked on all page loads involved in redirect auth flows.

  • hash - Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.

Returns a token response or null. If the return value is null, then no auth redirect was detected.

Known as handleRedirectPromise in MSAL.js.

Throws an AuthException if the redirect hash contained auth error information.

Implementation

Future<AuthenticationResult?> handleRedirectFuture([String? hash]) async {
  final response = await _convertMsalPromise<interop.AuthenticationResult?>(
      _callJsMethod(() => _jsObject.handleRedirectPromise(hash)));

  return response == null
      ? null
      : AuthenticationResult._fromJsObject(response);
}