appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
34.69k stars 3.75k forks source link

[Bug]: Google Auth from Supabase JS client doesn't work on Appsmith #24847

Open felix-appsmith opened 1 year ago

felix-appsmith commented 1 year ago

Is there an existing issue for this?

Description

I would like to use Supabase JS client with the custom JS library feature. However, I can't use the Google Auth function provided by supabase.js directly by calling supabaseClient.auth.signInWithOAuth(), it appears that calling URL is blocked when executing JS code. Calling the signin function should normally redirect the user to a Google official login screen, but in Appsmith gives an error:

Steps To Reproduce

  1. In your Appsmith application, add the @supabase/supabase-js library.
  2. Create a JS Object and write the neccesary code to create a new Supabase client, based on your credentials, and to sigin with Google OAuth authorization. The code should look like this:
    export default {
    async myFun1() {
    const supabaseURL = '<<Your supabase URL>>';
    const supabasekey = '<<Your supabase Key>>';
    const ss = supabase.createClient(supabaseURL, supabasekey);
    await ss.auth.signInWithOAuth({
      provider: 'google'
    });
    }
    };
  3. Execute the JS Object function (myFun1 if you copied the code above) and look at the TypeError: Cannot set property href of [object WorkerLocation] which has only a getter error. Note: To obtain the supabase credentials from your project, you can follow this guide.

Public Sample App

https://app.appsmith.com/app/cnv-118jjarw/page1-6490daf06298f54ae199fefd

Environment

Production

Issue video log

No response

Version

Cloud v1.9.24 / Self - Hosted v1.9.22

d-mok commented 4 weeks ago

it's over a year now, is there any update? this is preventing me from using appsmith altogether.

Nikhil-Nandagopal commented 4 weeks ago

@d-mok this is not a priority for us right now. You can use supabase as a database and connect to it using the postgres integration but not as an auth provider.