https://supabase.com/ logo
Join Discord
Powered by
# off-topic
  • g

    getpost

    08/08/2022, 11:38 AM
    Well, I tried doing what this guy did https://discord.com/channels/839993398554656828/869405720934744086/1004422759935385690 but for a select, only allow someone to select the groups they are members of
  • g

    getpost

    08/08/2022, 11:38 AM
    Copy code
    sql
    create policy "Allow users to read the groups they're in"
    on public.note_group
    for select
    using ( 
       (
          auth.uid() in ( 
             SELECT user_id
             FROM note_group_membership
             WHERE note_group_id = id
          )
       )
    )
  • g

    getpost

    08/08/2022, 11:38 AM
    something like this, but it doesn't work, it returns an empty list
  • g

    getpost

    08/08/2022, 11:40 AM
    the values are correct and the queries themselves return the values they should, it just doesn't work inside the policy
  • s

    silentworks

    08/08/2022, 11:48 AM
    @getpost please ask for help in the #843999948717555735 channel
  • g

    getpost

    08/08/2022, 11:48 AM
    oooh, I thought there wasn't one
  • g

    getpost

    08/08/2022, 11:48 AM
    it's all the way down there
  • g

    getpost

    08/08/2022, 11:48 AM
    thanks
  • p

    pincopallo

    08/09/2022, 12:26 AM
    do you know when normal query will be available for realtime stream as well? at the moment i see only eq,limit and order...
  • g

    garyaustin

    08/09/2022, 12:57 AM
    Please ask your question in help/general and be more specific on your question. js realtime just has .eq filter. Not sure if some other language sdk has limit and order.
  • t

    Tocas

    08/09/2022, 12:58 AM
    does anyone have any good examples of a request to Supabase from the backend of an app? (e.g. API routes in NextJS or endpoints in SvelteKit)
  • t

    Tocas

    08/09/2022, 12:59 AM
    how would you incorporate the user data into that (to get past RLS)? from what I understand, Supabase does this automatically when it's done from the frontend, but how would you do it from the backend?
  • g

    garyaustin

    08/09/2022, 1:01 AM
    https://github.com/supabase/auth-helpers Please ask any further help questions in Help General
  • e

    e0

    08/10/2022, 5:28 PM
    Hi @silentworks, I just refactored my app to use the auth helpers for svelte. Thanks for the great work on the helpers! The documentation is excellent too, it was really easy to follow.
  • d

    DeepITM

    08/10/2022, 5:50 PM
    hi guys! got a job with client from China. would like to learn how's the hosting speed in china if using the cloud host service?
  • f

    fernandops26

    08/10/2022, 6:47 PM
    Hi guys 👋. I am using nextjs with supabase to an web app, that works fine with her own login/signup. Also, I have a vscode extension, I would like login here too. I was thinking of some way to open an OAuth login from here in a new window (email+password, or github) and after login call to a local server created by the extension, exactly like following example with passport. Here, the server side, when finishing the login, then redirect to the local server created by the extension and provide the access token on the response:
    Copy code
    app.get(
        "/auth/github/callback",
        passport.authenticate("github", { session: false }),
        (req: any, res) => {
          res.redirect(`http://localhost:54321/auth/${req.user.accessToken}`);
        }
      );
    Here, extension side, command to call to the main server and get access token, after that, they use it to access to every protected route
    Copy code
    const app = polka();
    
      app.get(`/auth/:token`, async (req, res) => {
        const { token } = req.params;
        if (!token) {
          res.end(`<h1>something went wrong</h1>`);
          return;
        }
    
        await TokenManager.setToken(token);
        fn();
    
        res.end(`<h1>auth was successful, you can close this now</h1>`);
    
        (app as any).server.close();
      });
    
      app.listen(54321, (err: Error) => {
        if (err) {
          vscode.window.showErrorMessage(err.message);
        } else {
          vscode.commands.executeCommand(
            "vscode.open",
            vscode.Uri.parse(`${apiBaseUrl}/auth/github`)
          );
        }
      });
    But I am a little confused about how I should abort it using supabase. 😕
  • o

    Olyno

    08/10/2022, 7:04 PM
    Hi Please ask in the right channel, which is #843999948717555735 for now
  • f

    fernandops26

    08/10/2022, 7:05 PM
    ok thanks
  • a

    Ant

    08/11/2022, 12:13 AM
    haha @garyaustin did you make the supabrew emoji?? 😆
  • a

    Ant

    08/11/2022, 12:13 AM
  • g

    garyaustin

    08/11/2022, 12:15 AM
    No it was the winner of @Olyno 's contest...https://discord.com/channels/839993398554656828/988380101236371466 but I've got a wine one in the works 🤣
  • o

    Olyno

    08/11/2022, 12:22 AM
    All credits comes to @e0! I thought i did credits in my announcements, but looks i didn't 😅
  • s

    swikarrr

    08/11/2022, 7:27 AM
    hey guys so i am new to supabase and i tried creating a realtime chat app , well i haven't used any kind of realtime code such as .on subscribe but the message updates itself whenever i send message does the database provides realtime by default ?
  • m

    muji

    08/11/2022, 10:53 AM
    Hi guys
  • m

    muji

    08/11/2022, 10:53 AM
    Hope you all are doing fine
  • m

    muji

    08/11/2022, 10:54 AM
    I have a query (pun intended) if anyone of you could help me
    g
    • 2
    • 3
  • m

    muji

    08/11/2022, 10:55 AM
    So I have a Likes table which has user id and product Id, I also have a product table, what I essentially want to do it's get the most liked products in the last 36 hours (sort of trending products) I have to do this using curl cmd command, not JavaScript, any help? I tried looking into groupby etc but I couldn't find anything about it for curl
  • p

    pincopallo

    08/11/2022, 12:07 PM
    Is there anywhere a list of auth status error codes? like the one we get on signin "code:400 invelid credentials"
  • o

    Olyno

    08/11/2022, 2:03 PM
    Hey everyone! Don't forget to have a look in the new #1006358244786196510 channel! Should be a better place for everyone :p
  • g

    garyaustin

    08/11/2022, 2:05 PM
    I have a query pun intended if anyone of
1...247248249...392Latest