tryRestoreAuth method

Future<Authentication> tryRestoreAuth({
  1. bool retryWhenTimeout = false,
})

Running the application at startup will automatically re-authenticate the user.

If the user has already logged in before exiting the application, the user is automatically logged in based on the authentication information recorded in the application.

If retryWhenTimeout is true, retries are attempted even if the authentication times out.

アプリ起動時に実行することで自動的に再認証を行ないます。

アプリ終了前にすでにログインしていた場合、アプリ内に記録されている認証情報を元に自動的にログインを行います。

retryWhenTimeouttrueになっている場合、認証がタイムアウトした場合でもリトライを試みます。

Implementation

Future<Authentication> tryRestoreAuth({
  bool retryWhenTimeout = false,
}) async {
  await adapter.tryRestoreAuth(
    onUserStateChanged: notifyListeners,
    retryWhenTimeout: retryWhenTimeout,
  );
  if (isSignedIn) {
    for (final action in _effectiveActions) {
      await action.onRestoredAuth();
    }
  }
  return this;
}