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

    J0

    12/29/2021, 11:56 AM
    oh ok so, the
    supabase
    library is tagged to a commit which doesn't have
    match
    released. We can update that and publish a new release. As for the
    dataclasses
    bug let me think about it for a moment and get back to you
  • j

    J0

    12/29/2021, 11:58 AM
    So sorry that you had to go through this
  • j

    J0

    12/29/2021, 11:58 AM
    That would be great if you have the time. Thanks much!
  • s

    Steve

    12/29/2021, 12:01 PM
    fuzzy search query
  • j

    J0

    12/29/2021, 12:11 PM
    I think 30% should be fine. I'm running a vanilla instance of Supabase with just the
    countries
    table and it seems to use about ~30% as well. Not too sure how to check exact breakdown though.
  • j

    jmsunseri

    12/29/2021, 12:21 PM
    how do you configure what data associated with the user from the db is returned i the user_metadata object when a session is returned after loggin in?
    l
    • 2
    • 13
  • a

    Anoushk

    12/29/2021, 12:33 PM
    Sure thanks
  • u

    user

    12/29/2021, 12:34 PM
    Hi, I have a question which I cannot find an answer for. Does supabase has a feature which would allow me to execute code when it detects that user have disconnected from realtime feed?
  • j

    jmsunseri

    12/29/2021, 1:07 PM
    if i take that access_token returned by clicking on the magic link in an email (that's the only auth method i have set up right now) and pass that back as a header in a call to my server side api if I call client.auth.setAuth(access_token) it should work right? right now it's just returning null for me
  • j

    jmsunseri

    12/29/2021, 1:08 PM
    these examples are wrong https://supabase.com/docs/reference/javascript/auth-setauth setAuth doesn't return an object that contains { error }
  • j

    jmsunseri

    12/29/2021, 1:14 PM
    setAuth returns something like this {"access_token":"ey.......rNjfA","token_type":"bearer","user":null}
  • k

    ktosiek

    12/29/2021, 1:19 PM
    .setAuth()
    is a pretty low-level thing. If you can, use
    .signIn({refresh_token: ...})
    - that will setup the session, current user, and background token refresh (at least in browser it should)
  • j

    jmsunseri

    12/29/2021, 1:21 PM
    i switched to something more like this
    Copy code
    supabase.auth.setAuth(headers.authorization);
        const { user } = await supabase.auth.api.getUser(headers.authorization);
  • a

    Anoushk

    12/29/2021, 1:21 PM
    @User when will the change be pushed?
  • k

    ktosiek

    12/29/2021, 1:26 PM
    the access_token is only useful for one hour. You should've gotten a refresh_token in the email login link, that's the one you want to use (with
    signIn
    )
  • j

    jmsunseri

    12/29/2021, 1:26 PM
    well i changed it to be good for a week
  • j

    J0

    12/29/2021, 1:27 PM
    Hey Maverick, Apologies for the delay. I'd say it'll take about another 30 mins or so at least
  • j

    jmsunseri

    12/29/2021, 1:27 PM
    once that expires you can make a call with the refresh token to get a new access token so long as your refresh token hasn't been revoked
  • j

    jmsunseri

    12/29/2021, 1:27 PM
    right?
  • k

    ktosiek

    12/29/2021, 1:27 PM
    that's... not optimal for security, 1h is already pretty long
  • j

    jmsunseri

    12/29/2021, 1:28 PM
    you're probably right
  • k

    ktosiek

    12/29/2021, 1:28 PM
    yes, and if you use
    signIn()
    then the supabase lib should refresh tokens in the background
  • a

    Anoushk

    12/29/2021, 1:28 PM
    yea 30 mins works thanks for the help
  • j

    jmsunseri

    12/29/2021, 1:34 PM
    i should only be sending the refresh token back server side once the access_token has expired
  • j

    jmsunseri

    12/29/2021, 1:34 PM
    i have svelte kit rest api between my front end and supabase
  • x

    xtc

    12/29/2021, 2:03 PM
    Hi, is it possible to use a custom domain for the api endpoint on the cloud offering, instead of *.supabase.co?
  • j

    jmsunseri

    12/29/2021, 2:23 PM
    when i try to sign in using my refresh token it just says invalid refresh token.... i set the jwt expiration down to 2 minutes in hopes that this would allow me to really test JWT expiry and replacing with a session using the refresh_token
  • k

    ktosiek

    12/29/2021, 2:28 PM
    refresh_token is single use, so make sure you're using the last one
  • j

    jmsunseri

    12/29/2021, 2:44 PM
    right
  • j

    jmsunseri

    12/29/2021, 2:44 PM
    why does the client keep making this call? https://otdbbakdeabkncevqxxh.supabase.co/auth/v1/token?grant_type=refresh_token
1...177178179...316Latest