Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/gotrue/lib/src/gotrue_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ class GoTrueClient {

Timer? _autoRefreshTicker;

/// Completer to combine multiple simultaneous token refresh requests.
/// Deduplicates concurrent token refresh requests.
///
/// When multiple callers detect an expired token simultaneously (e.g. several
/// in-flight API requests all fail with 401), only the first creates a new
/// refresh network request. Subsequent callers receive the same [Future] and
/// wait for the single in-flight request to complete. The completer is cleared
/// after resolution so the next expiry cycle starts a fresh request.
Completer<AuthResponse>? _refreshTokenCompleter;

JWKSet? _jwks;
Expand Down
Loading