completeOAuthProviderLogin method

Future<void> completeOAuthProviderLogin(
  1. Uri redirectUrl
)

Completes an OAuth provider login, given the Nhost OAuth provider's redirectUrl.

For more information on redirect URLs, see https://docs.nhost.io/auth/oauth-providers.

For an example of this in practice, see the nhost_flutter_auth package's OAuthProvider example.

Implementation

Future<void> completeOAuthProviderLogin(Uri redirectUrl) async {
  final queryArgs = redirectUrl.queryParameters;
  if (!queryArgs.containsKey(refreshTokenQueryParamName)) {
    return;
  }

  await _refreshToken(queryArgs[refreshTokenQueryParamName]);
}