supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
656 stars 154 forks source link

Self Hosted Supabase is not registering Users from Flutter SDK, Opposed to the hosted version which can. #934

Open adlahd3 opened 1 month ago

adlahd3 commented 1 month ago

Describe the bug I am using self hosted supabase on linux, docker and docker compose. Published over the internet. I am trying to interact with it through the flutter SDK. I have the following error on the terminal.

D/EGL_emulation(30987): app_time_stats: avg=8798.66ms min=5.59ms max=228297.12ms count=26 E/flutter (30987): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: AuthException(message: FormatException: Unexpected character (at character 5) E/flutter (30987): 404 page not found E/flutter (30987): ^ E/flutter (30987): , statusCode: null) E/flutter (30987): #0 GotrueFetch._handleError (package:gotrue/src/fetch.dart:46:7) E/flutter (30987): #1 GotrueFetch._handleRequest (package:gotrue/src/fetch.dart:141:13) E/flutter (30987): <asynchronous suspension> E/flutter (30987): #2 GotrueFetch.request (package:gotrue/src/fetch.dart:88:12) E/flutter (30987): <asynchronous suspension> E/flutter (30987): #3 GoTrueClient.signUp (package:gotrue/src/gotrue_client.dart:214:18) E/flutter (30987): <asynchronous suspension> E/flutter (30987): #4 _MyHomePageState.signUp.<anonymous closure> (package:main_app/main.dart:88:19) E/flutter (30987): <asynchronous suspension> E/flutter (30987): #5 _MyHomePageState.signUp (package:main_app/main.dart:84:35) E/flutter (30987): <asynchronous suspension> E/flutter (30987):

However, I am running the same code but changing to my supabase hosted version it works fine.

To Reproduce Steps to reproduce the behavior: Use the flutter snippet against a self hosted Supabase instance.

final AuthResponse response = await sbClient.auth.signUp( email: email, password: password, ) .whenComplete(() => print('Block Completed.'));

Expected behavior User should be registered.

Version (please complete the following information): On Linux/macOS Please run dart pub deps | grep -E "supabase|gotrue|postgrest|storage_client|realtime_client|functions_client" in your project directory and paste the output here.

├── supabase_flutter 2.5.3 │ ├── supabase 2.1.3 │ │ ├── functions_client 2.2.0 │ │ ├── gotrue 2.7.0 │ │ ├── postgrest 2.1.2 │ │ ├── realtime_client 2.0.4 │ │ ├── storage_client 2.0.1

Additional context Add any other context about the problem here.

dshukertjr commented 4 weeks ago

You probably have the wrong Supabase URL passed to Supabase.initialize() call for the self-hosted version. Try to see if any of the API methods work. If not, double check that you have the correct URL. You might be passing the URL to access the studio.