File tree 2 files changed +11
-9
lines changed 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -91,13 +91,15 @@ class SupabaseClient {
91
91
..clear ()
92
92
..addAll (_headers);
93
93
94
- auth.headers
95
- ..clear ()
96
- ..addAll ({
97
- ...Constants .defaultHeaders,
98
- ..._getAuthHeaders (),
99
- ...headers,
100
- });
94
+ if (accessToken == null ) {
95
+ auth.headers
96
+ ..clear ()
97
+ ..addAll ({
98
+ ...Constants .defaultHeaders,
99
+ ..._getAuthHeaders (),
100
+ ...headers,
101
+ });
102
+ }
101
103
102
104
// To apply the new headers in the realtime client,
103
105
// manually unsubscribe and resubscribe to all channels.
@@ -142,7 +144,7 @@ class SupabaseClient {
142
144
functions = _initFunctionsClient ();
143
145
storage = _initStorageClient (storageOptions.retryAttempts);
144
146
realtime = _initRealtimeClient (options: realtimeClientOptions);
145
- if (accessToken ! = null ) {
147
+ if (accessToken = = null ) {
146
148
_listenForAuthEvents ();
147
149
}
148
150
}
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ void main() {
192
192
return 'jwt' ;
193
193
});
194
194
expect (
195
- supabase.auth.currentUser,
195
+ () => supabase.auth.currentUser,
196
196
throwsA (AuthException (
197
197
'Supabase Client is configured with the accessToken option, accessing supabase.auth is not possible.' )));
198
198
});
You can’t perform that action at this time.
0 commit comments