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

AuthException(message: FormatException: Unexpected end of input (at character 1) #1587

Closed
ShJavokhir opened this issue May 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ShJavokhir
Copy link

Describe the bug
I think this bug is by supabase backend side but not sure. I just wrote simple code that sends idToken and nonce to ssignInIdToken() function. I am sure idToken and nonce are valid. But this request cased following error:

flutter: AuthException(message: FormatException: Unexpected end of input (at character 1) ^ , statusCode: null)

Then I tried to find out api this package calling and try to call it myself on postman. I found api endpoint and it was https://xxxxxxx.supabase.co//auth/v1/authorize (I hide my project id). I called this manually in postman and got blank body with 404 statuc code. And I guess error above is due to supabase not returning body message in json.

To Reproduce
await supabaseClient.auth.signInWithIdToken( provider: OAuthProvider.google, idToken: idToken, nonce: rawNonce, );

Expected behavior
Should work normally

Screenshots
image

Version (please complete the following information):
On Linux/macOS
image

@ShJavokhir ShJavokhir added the bug Something isn't working label May 21, 2024
@dshukertjr
Copy link
Member

@ShJavokhir For Google sign-in, you need to also send the access token as shown in the docs here:
https://supabase.com/docs/guides/auth/social-login/auth-google?queryGroups=platform&platform=flutter

Either way, the backend not returning a valid error message is a bug, so let me transfer this issue to our backend repo.

@dshukertjr dshukertjr transferred this issue from supabase/supabase-flutter May 22, 2024
@dshukertjr dshukertjr removed the auth label May 22, 2024
@rodrifelix99
Copy link

I am also having this issue with email sign in, apple sign in and google sign in. All were working yesterday and the code from my side hasn't changed.

@ShJavokhir
Copy link
Author

Realized something has changed in supabase side after their v2 architecture migration, here what my code looked like before solving this issue:

await Supabase.initialize( url: "https://xxxxxxxx.supabase.co/", anonKey: "eyxxxxxxxxxx", );

Here is how I solved it:

await Supabase.initialize( url: "https://xxxxxxxx.supabase.co", anonKey: "eyxxxxxxxxxx", );

Yeah just one slash caused problem all of a sudden. Had to update both apps on play store and appstore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants