Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow null to be returned from accessToken function when the user is not signed in #1099

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/supabase/lib/src/supabase_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class SupabaseClient {
late final PostgrestClient rest;
StreamSubscription<AuthState>? _authStateSubscription;
late final YAJsonIsolate _isolate;
final Future<String> Function()? accessToken;
final Future<String?> Function()? accessToken;

/// Increment ID of the stream to create different realtime topic for each stream
final _incrementId = Counter();
Expand Down
4 changes: 2 additions & 2 deletions packages/supabase_flutter/lib/src/supabase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Supabase with WidgetsBindingObserver {
PostgrestClientOptions postgrestOptions = const PostgrestClientOptions(),
StorageClientOptions storageOptions = const StorageClientOptions(),
FlutterAuthClientOptions authOptions = const FlutterAuthClientOptions(),
Future<String> Function()? accessToken,
Future<String?> Function()? accessToken,
bool? debug,
}) async {
assert(
Expand Down Expand Up @@ -186,7 +186,7 @@ class Supabase with WidgetsBindingObserver {
required PostgrestClientOptions postgrestOptions,
required StorageClientOptions storageOptions,
required AuthClientOptions authOptions,
required Future<String> Function()? accessToken,
required Future<String?> Function()? accessToken,
}) {
final headers = {
...Constants.defaultHeaders,
Expand Down
Loading