supabase-flutter 1.0.1 refresh token gone

When I'm idling in my flutter app with supabase-flutter 1.0.1 I receive this error:
flutter: ***** SupabaseDeepLinkingMixin startAuthObserver
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: AuthException(message: refresh_token required, statusCode: 400)
#0 GotrueFetch.request
package:gotrue/src/fetch.dart:99
<asynchronous suspension>
#1 GoTrueClient._callRefreshToken
package:gotrue/src/gotrue_client.dart:588
<asynchronous suspension>
flutter: ***** SupabaseDeepLinkingMixin startAuthObserver
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: AuthException(message: refresh_token required, statusCode: 400)
#0 GotrueFetch.request
package:gotrue/src/fetch.dart:99
<asynchronous suspension>
#1 GoTrueClient._callRefreshToken
package:gotrue/src/gotrue_client.dart:588
<asynchronous suspension>
Seems to be a problem getting a refresh token. This happens when I do nothing in the app (just have it open, not interacting with the app at all). Any ideas?
1 Reply
thomasmol
thomasmolOP3y ago
I initialize the supabase client in my main.dart like so:
await Supabase.initialize(
url: dotenv.env['SUPABASE_URL'] ?? '',
anonKey: dotenv.env['SUPBASE_ANON_KEY'] ?? '',
authCallbackUrlHostname: 'login-callback');
await SupabaseAuth.initialize(authCallbackUrlHostname: 'reset-callback');
await Supabase.initialize(
url: dotenv.env['SUPABASE_URL'] ?? '',
anonKey: dotenv.env['SUPBASE_ANON_KEY'] ?? '',
authCallbackUrlHostname: 'login-callback');
await SupabaseAuth.initialize(authCallbackUrlHostname: 'reset-callback');

Did you find this page helpful?