desktopSignIn method

void desktopSignIn(
  1. AuthAction action
)
inherited

Handles authentication logic on desktop platforms

Implementation

void desktopSignIn(AuthAction action) {
  DesktopWebviewAuth.signIn(desktopSignInArgs).then((value) {
    if (value == null) throw AuthCancelledException();

    final oauthCredential = fromDesktopAuthResult(value);
    onCredentialReceived(oauthCredential, action);
  }).catchError((err) {
    if (err is AuthCancelledException) {
      authListener.onCanceled();
      return;
    }

    authListener.onError(err);
  });
}