https://supabase.com/ logo
Join Discord
Powered by
# javascript
  • j

    Josué Ayala

    07/22/2022, 5:27 AM
    Hey, have a great day 🌥️ I have a question, how can do or how can handle the
    supabase.auth.user()
    on the server side, the main reason is cuz I'm trying to create a route middleware with nuxt.js
  • r

    rinorzk

    07/22/2022, 8:35 AM
    I'm currently using
    @supabase/auth-helpers-nextjs
    you should give it a try
  • r

    rinorzk

    07/22/2022, 8:36 AM
    yo is anyone having this weird behavior with real time subscription, the status of it shows, CLOSED then SUBSCRIBED then CLOSED again, I try to insert a row in a table, and it doesn't update it in real time, but when I go to another tab and return to my app it shows the newly added row?
  • r

    rinorzk

    07/22/2022, 8:58 AM
    I try to turn off react strict mode, but still the same
  • g

    Gianni

    07/22/2022, 3:52 PM
    So i am currently trying to create a SignUp with Discord and i run into the following problem. On Callback i get this Error. I double checked all URL's and Key's and only used the official function example:
    Copy code
    ts
    async function signInWithDiscord() {
      const { user, session, error } = await supabase.auth.signIn({
        provider: 'discord',
      })
    }
  • g

    Gianni

    07/22/2022, 3:54 PM
    The user anyhow, gets added to the Database successfully, so i am kinda confused whats going on now 0.o
    • 1
    • 1
  • f

    freshandlow

    07/22/2022, 4:39 PM
    Hi, I'd like to use the new Next Js Auth components, but struggling with how to style up the buttons & text. I can style up individual components from Supabase UI - e.g. set the backgroundColor of a button by passing style : {backgroundColor : 'Red"} but once inside the Auth component I can't figure out how to style up the subcomponents. Is there any guide to how to use the style props of the Auth components to fully style them up? Thanks
  • g

    Gianni

    07/22/2022, 4:57 PM
    Discord SignIn Problem
  • s

    skyclo

    07/22/2022, 9:03 PM
    I'm trying to verify a user JWT. My current setup is a React frontend that sends the JWT over a websocket to a remote backend running Node.js. This backend communicates with Supabase along with the React frontend. The front-end works perfectly fine (I can sign up through any service, I can fetch stuff from the DB protected by auth-based RLS rules, etc). However, when I attempt to verify (both in Remix's frontend/backend and on the Node.js backend), I'm immediately met with a 401 error (
    "Invalid token: token is expired by 8m21s"
    ). I tested this further and attempted to refresh the token only to be met with the same error but with a time of
    1s
    . Can anyone help in regards to why my JWTs are immediately expiring after being generated?
    • 1
    • 7
  • t

    Tekey

    07/24/2022, 5:25 AM
    Anyone facing the issue where the real time works sometimes and breaks sometimes? The client is subscribing but it is not listening to any table updates
  • p

    PhantomCode

    07/24/2022, 8:00 AM
    ping
  • p

    PhantomCode

    07/24/2022, 8:34 AM
    I don't want to use RLS policies and would like to manage the authorization stuff on my node-server. For some reason, I didn't find anything helpful on the web regarding best practices so my approach is to create a supabase client on the server with the service role key so that it can bypass the RLS. Is that an adequate approach?
    s
    • 2
    • 1
  • s

    silentworks

    07/24/2022, 10:18 AM
    Node auth
  • j

    jJ

    07/24/2022, 3:22 PM
    Anyone good with edge functions and how to import correctly?
    Copy code
    javascript
    // index.ts
    import { serve } from "https://deno.land/std@0.131.0/http/server.ts"
    import puppeteer from "https://deno.land/x/puppeteer@9.0.0/mod.ts";
    import { cheerio } from "https://deno.land/x/cheerio@1.0.6/mod.ts";
    
    serve(async (req) => {
      const { url } = await req.json()
      const browser = await puppeteer.launch();
      const page = await browser.newPage();
      await page.goto(url);
      const html = await page.content();
      const $ = cheerio.load(html);
      const title = $('title');
      const data = {
        title: title,
      }
    
      return new Response(
        JSON.stringify(data),
        { headers: { "Content-Type": "application/json" } },
      )
    })
    on supabase functions deploy myfunc returns:
    Copy code
    bash
    Error: Error bundling function: exit status 1
    error: TS2339 [ERROR]: Property 'load' does not exist on type '(selector: any, context: any, root: any, opts: any) => any'.
      const $ = cheerio.load(html);
    Many thanks in advance, Joe
  • t

    Tekey

    07/24/2022, 4:25 PM
    Hi did anyone tried using const { error } = await supabase.auth.signOut() to sign a user out but the access token is still there even after signing out?
  • g

    garyaustin

    07/24/2022, 4:51 PM
    The jwt is still valid until it expires. The refresh token though gets invalidated on the server.
  • t

    Tekey

    07/24/2022, 4:57 PM
    thanks!
  • m

    metruzanca

    07/24/2022, 10:15 PM
    Trying to get the realtime to work, got replication setup and I'm getting updates but all the updates I get come back with unauthorized.
  • m

    metruzanca

    07/24/2022, 10:41 PM
    We've got our own JWT authentication so I'm really confused how we're meant to authenticate for realtime
  • g

    garyaustin

    07/24/2022, 10:55 PM
    You probably need to add a role to the jwt either 'anon' or 'authenticated'
  • m

    metruzanca

    07/24/2022, 10:56 PM
    Could I get a little more detail on how to do this?
  • m

    metruzanca

    07/24/2022, 10:56 PM
    Like how do I then authenticate the supabaseClient?
  • m

    metruzanca

    07/24/2022, 10:56 PM
    (also no clue how to "add a role to the jwt")
    g
    • 2
    • 48
  • m

    metruzanca

    07/24/2022, 10:58 PM
    In the DB, under Roles its showing I have no anon's connected as well which is strange
  • m

    metruzanca

    07/24/2022, 10:58 PM
    And the api logs does show my websocket connections
  • m

    Mattyfaz

    07/25/2022, 12:51 PM
    Creating a nuxt3 app and I'm wanting to use a private bucket on Supabase for hosting images, how can I get the URL for
    <img src="xxx">
    ? I can only seem to get it to work by making it public.
  • g

    garyaustin

    07/25/2022, 1:07 PM
    https://supabase.com/docs/reference/javascript/storage-from-createsignedurl createSignedUrl is the way to get a storage file url with token for private buckets. You do need to allow select access RLS policy to get the signed url.
  • m

    Mattyfaz

    07/25/2022, 1:45 PM
    Thanks @garyaustin , looks like that works. Is there a way to make it not expire? Or alternatively is there any limit? If not I can make it large
  • g

    garyaustin

    07/25/2022, 1:49 PM
    Not sure what the upper limit, but you can make as many seconds as desired. The token is just a jwt with an expiration “time”. At some point though you might as well have a public bucket (only difference is url does not expire) with a hard to guess name.
  • m

    Mattyfaz

    07/25/2022, 1:57 PM
    Fair point, the web app is just for my family and will have images of us hence why I wanted it for authenticated users only. However I also wanted to avoid performing an api call per image to get the url every time someone opened the web app. I thought I might be able to createSignedUrl when the image is uploaded and store the URL in a table. Therefore being able to pull the url of all images at once 🙂
    g
    • 2
    • 2
1...747576...81Latest