Issue
I have a working small Project which uses a supabase-backend for Data and Authentication. Everything works as intended and especially the OAuth works like a charm.
Now i wanted to implement Deep-Links for my custom Business Logic (before only Supabase was using deep links for OAuth). And i get it to work (I can receive links when i open it via a Scheme).
BUT it also throws an error, because of Supabase. Whenever i open the App via a link, i get the Error:
I/flutter (21576): ***** SupabaseDeepLinkingMixin startAuthObserver <-- Supabase handler
I/flutter (21576): ***** SupabaseAuthState handleDeeplink http://mydomain/tempdev
I/flutter (21576): onReceivedAuthDeeplink uri: http://mydomain/tempdev
E/flutter (21576): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: AuthException(message: No access_token detected., statusCode: null)
E/flutter (21576):
E/flutter (21576): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: AuthException(message: No access_token detected., statusCode: null)
E/flutter (21576):
I/flutter (21576): No access_token detected.
I/flutter (21576): Initial Uri handle <-- My custom handler
Ive tried using another scheme for OAuth or Custom stuff and it didnt change anything.
My intent-filters:
<intent-filter>
<action
android:name="android.intent.action.VIEW" />
<category
android:name="android.intent.category.DEFAULT" />
<category
android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="de.my.package" />
</intent-filter>
<intent-filter>
<action
android:name="android.intent.action.VIEW" />
<category
android:name="android.intent.category.DEFAULT" />
<category
android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="my.hos" />
<data android:scheme="https" />
</intent-filter>
I know what the error means: It tries to detect the auth-token when the OAuth-Provider is redirecting to the callback, but fails. But this feels like a weird error, am i doing something wrong? It feels like supabase is checking for an error where there is none, instead of Throwing an error it should just not do anything (?). Can someone explain it to me.
About my Project:
In my Code for handling custom Deep-Links im following the uni-links example. And for Supabase im using the supabase-flutter package and not doing anything "fancy".
I focus on Deploying it on Android and not doing anything with iOS/Windows/Web.
Is there anything i can do to resolve this? Is this even a "bad" error, or something i can ignore in release-mode? Right now it throws and interrupts while im in debug-mode.
Solution
After creating a Issue on the flutter_supabase GitHub they showed me that upgrading to supabase_flutter v1.2.1 fixes the error.
Answered By - Raqha
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.