addSessionRefreshFailedCallback method

  1. @override
UnsubscribeDelegate addSessionRefreshFailedCallback(
  1. SessionRefreshFailedCallback callback
)

Add a callback that will be invoked when the service fails to refresh its session.

Session refreshes happen periodically based on settings configured in the Nhost console, and also through signInWithRefreshToken and signInWithStoredCredentials.

The returned function will remove the callback when called.

Implementation

@override
UnsubscribeDelegate addSessionRefreshFailedCallback(
    SessionRefreshFailedCallback callback) {
  _sessionRefreshFailedCallbacks.add(callback);
  return () {
    _sessionRefreshFailedCallbacks
        .removeWhere((element) => element == callback);
  };
}