getToken property

FutureOr<String?> Function() getToken
final

Authentication callback. Note – must include prefixes, e.g. 'Bearer $token'

This is called once per request, and once more for a refresh-and-replay. It must be idempotent and cheap: concurrent 401s share a single in-flight refresh (see _refreshing), but a callback that mints a different token on every call will still hand a different value to each replay. Prefer reading an already-refreshed value (for example () => authStore.token) over performing the refresh inside this callback.

Implementation

final FutureOr<String?> Function() getToken;