https://supabase.com/ logo
Join Discord
Powered by
# help
  • g

    garyaustin

    03/03/2022, 8:08 PM
    How to use extension
  • j

    joa

    03/03/2022, 9:01 PM
    I'm playing around with Supabase, but I'm struggling with the RLS policies. I've created a simple table, and when RLS is not applied, I can POST and GET using Postman with just the ANON key (as apikey + bearer token). I am able to insert and select rows. However, the purpose of the RLS is for any user to only be able to interact with his own data, right? I've created a user, which then has an
    uid
    , but how do I incorporate that uid in the POST/GET requests? Is it some header?
    g
    • 2
    • 45
  • g

    garyaustin

    03/03/2022, 9:19 PM
    user based RLS policies without auth
  • r

    rahat

    03/03/2022, 11:41 PM
    anyone used discord oauth with scopes in supabase? i'm trying to figure out best way to add the guilds.members.read scope
  • i

    irrationaljared

    03/04/2022, 2:03 AM
    Sometimes when I call
    supabaseClient.auth.user()
    from the client I get a user back but when that user makes a request from the client to the server and I call
    supabaseClient.auth.api.getUserByCookie(req, res)
    on the server I get an error saying "Invalid Refresh Token". How is supposed to be handled? Am I missing documentation about this?
  • b

    bluetoothfx

    03/04/2022, 3:05 AM
    Having CORS issue. Can anyone point me to right direction? SupabaseClient is created successfully.
  • s

    Scott P

    03/04/2022, 3:43 AM
    Since you appear to be running a local supabase instance, check this https://github.com/supabase/supabase/issues/5540 (Even if you're not using the dashboard, it's still relevant since the port your page is running from and the port of the Kong instance are different)
  • a

    AmusedGrape

    03/04/2022, 3:56 AM
    does supabase automatically connect oauth accounts together, and if so, how? is it by email or does it detect the authed user when connecting a new account?
    g
    • 2
    • 2
  • b

    bluetoothfx

    03/04/2022, 4:01 AM
    Thanks Scott. Will take a look and share update with you.
  • g

    garyaustin

    03/04/2022, 4:06 AM
    linked accounts
  • d

    deliana

    03/04/2022, 5:42 AM
    πŸ˜€ anyone know? about signing out https://github.com/supabase/supabase/discussions/5791
  • a

    Axel

    03/04/2022, 9:07 AM
    Hi, have this been solved? I'm also getting the same issue (not running from local supabase instance)
  • r

    rohanrajpal

    03/04/2022, 9:28 AM
    Hey I have a table by the name
    bookings
    Now I need to fetch its schema, how do I do it via the SQL editor? Running
    describe bookings;
    gives an error
    syntax error at or near "describe"
    Also where do I get the database name? Is it the project name? if yes then
    describe crud_backend.bookings;
    is throwing the same error as well Would appreciate any help πŸ™
  • s

    silentworks

    03/04/2022, 9:54 AM
    Project limit
  • j

    joshcawthorne

    03/04/2022, 11:31 AM
    Hello πŸ™‚ Does anyone know if it's possible to use RLS to block requests for specific columns of data within a table?
    g
    • 2
    • 2
  • b

    bluetoothfx

    03/04/2022, 1:58 PM
    Where I should put this? Under which section please?
    Copy code
    extra_hosts:
      - "host.docker.internal:host-gateway"
  • g

    garyaustin

    03/04/2022, 2:00 PM
    Column Security
  • c

    Ciriak

    03/04/2022, 2:10 PM
    Hi ! Any idea if there is a clean way to invoke
    textSearch()
    conditionally ? In this example i don't want to invoke textSearch() if searchQuery is empty I tried passing "*" or an empty string but no luck and i didn't find anything on the documentation about "empty textSearch" πŸ€”
    g
    • 2
    • 2
  • a

    ak4zh

    03/04/2022, 4:45 PM
    Unable to login to supabase: https://app.supabase.io/?error=server_error&error_description=failed+to+connect+to+%60host%3Dprod-2.c7y43uscdbtq.ap-southeast-1.rds.amazonaws.com+user%3Dauth_admin+database%3Dpostgres%60%3A+server+error+%28FATAL%3A+sorry%2C+too+many+clients+already+%28SQLSTATE+53300%29%29
  • b

    bradgarropy

    03/04/2022, 5:23 PM
    Next.js SSR Authentication I'm using the
    @supabase/supabase-auth-helpers
    package to enable authentication in Next.js on the client and the server. https://github.com/supabase-community/supabase-auth-helpers/tree/main/src/nextjs After logging in, I redirect over to
    /todos
    .
    Copy code
    const handleSignin: FormEventHandler<HTMLFormElement> = async event => {
            event.preventDefault()
    
            await supabase.auth.signIn({
                email,
                password,
            })
    
            router.push("/todos")
        }
    But the redirect doesn't work the first time. Or it's bouncing back to
    /login
    . After logging in a second time, then it work. I presume because the session cookie has not yet been set.
    Copy code
    const getServerSideProps = withAuthRequired({
        redirectTo: "/login",
        getServerSideProps: async ctx => {
            const todos = await readAllTodos(ctx)
    
            return {
                props: {
                    initialTodos: todos,
                },
            }
        },
    })
    Here's the live site and the code. https://next-todo-one.vercel.app https://github.com/bradgarropy/next-todo
    t
    • 2
    • 8
  • t

    thorwebdev

    03/04/2022, 5:39 PM
    Supabase Auth Helpers help
  • x

    xavier

    03/04/2022, 8:22 PM
    Hey, I'm facing the same issue. Did you managed to make it work?
  • r

    ramoncarden

    03/05/2022, 4:15 AM
    hello Im working on a react chat application and im having an infinite loop problem when I run the code below. Does anyone know where Im making the mistake? Im attempting to query the messages where the room id matches the channel id and its works for the most part, but the console.log(roomId) line is running nonstop and Im not quite sure where my mistake is.
    Copy code
    js
    const ChatRoom = ({ session }) => {
      const { roomId } = useParams();
    
      const getAllMessages = async () => {
        console.log(roomId);
        let { data, error } = await supabase
          .from('messages')
          .select('*')
          .eq('channel_id', roomId);
        if (error) {
          console.log(error);
        }
        if (data) {
          setMessages(data);
        }
      };
    
      const messageSubscription = supabase
        .from('messages')
        .on('*', (message) => {
          console.log('Change received!', message);
        })
        .subscribe();
    
      useEffect(() => {
        getAllMessages();
      }, [messageSubscription]);
  • g

    garyaustin

    03/05/2022, 4:53 AM
    What is your purpose in using messageSubscription as a useEffect condition? If you want to reload all messages you should set a variable in the .on handler as that triggers when update occurs.
  • r

    ramoncarden

    03/05/2022, 4:59 AM
    I perhaps don’t understand the useEffect hook as well as I thought. I thought the subscription would not run if I was not listening for changes
  • r

    ramoncarden

    03/05/2022, 5:02 AM
    Should the dependency array here be empty?
    g
    • 2
    • 1
  • r

    risingryzen

    03/05/2022, 6:11 AM
    Hi all, I am trying to play around with Supabase. Appreciate the help. I am using the DivJoy starter. I have a simple setup with two tables,
    users
    and
    items
    . I am trying to enable RLS on
    items
    so that a user can only update their own
    items
    . My RLS rule is:
    Copy code
    create policy "Can only update their own items." on items for update using (
      auth.uid() = owner
    )
    I keep seeing
    new row violates row-level security policy for table "items"
    however in the NextJS app. I am passing in the owner field in the request.
    Copy code
    {name: "test1", owner: "b1975ef4-f65c-4db5-8f4b-e63f128cf8c6"}
    name: "test1"
    owner: "b1975ef4-f65c-4db5-8f4b-e63f128cf8c6"
    s
    • 2
    • 6
  • f

    fengkx

    03/05/2022, 10:10 AM
    Hi, I am using a create trigger to sync
    auth.users
    table to
    public.pusers
    in supabase. I have a enum column call
    user_role
    with enum type in
    pusers
    table. I try to update my docker and I found
    Database error saving new user" component=api error="failed to close prepared statement: ERROR: current transaction is aborted, commands ignored until end of transaction block (SQLSTATE 25P02): ERROR: type \"user_role\" does not exist
    this error in when I use the sdk to sign up a user. But I can successfully insert a row to
    auth.users
    and sync to
    pusers
    by directly run SQL in psql
  • f

    fengkx

    03/05/2022, 10:11 AM
    I found https://github.com/supabase/supabase/issues/4529 and https://github.com/supabase/supabase/issues/563 seems to have similar issue
    g
    • 2
    • 1
  • r

    ramprit

    03/05/2022, 10:54 AM
    How to reset database password
    s
    • 2
    • 2
1...237238239...316Latest