checkUrl method

  1. @override
bool checkUrl(
  1. Uri url
)
override

This will check if the current URL has authentication tokens.

Implementation

@override
bool checkUrl(Uri url) {
  Uri _redirectUri = Uri.parse(redirectUrl!);
  try {
    if (url.host != _redirectUri.host) return false;
    var params = splitFragment(url.fragment);
    if (params.isEmpty) return false;
    if (!params.containsKey(authCodeKey)) return false;
    var code = params[authCodeKey];
    foundAuthCode(code);
    return true;
  } catch (exception) {
    print(exception);
    return false;
  }
}