NhostAuthClient constructor
NhostAuthClient({})
authStore
(optional) is used to persist authentication tokens
between restarts of your app. If not provided, the tokens will not be
persisted.
tokenRefreshInterval
(optional) is the amount of time the client will
wait between refreshing its authentication tokens. If not provided, will
default to a value provided by the server.
httpClientOverride
(optional) can be provided in order to customize the
requests made by the Nhost APIs, which can be useful for proxy
configuration and debugging.
Implementation
NhostAuthClient({
required String url,
UserSession? session,
AuthStore? authStore,
Duration? tokenRefreshInterval,
http.Client? httpClient,
}) : _apiClient = ApiClient(
Uri.parse(url),
httpClient: httpClient ?? http.Client(),
),
_session = session ?? UserSession(),
_authStore = authStore ?? InMemoryAuthStore(),
_tokenRefreshInterval = tokenRefreshInterval,
_refreshTokenLock = false,
_loading = false;