https://supabase.com/ logo
Join DiscordCommunities
Powered by
# help
  • f

    frubalu

    07/27/2021, 7:00 PM
    i can see the user being updated inside of the Supabase console and everything
  • f

    frubalu

    07/27/2021, 7:01 PM
    it's essentially running the
    signIn()
    method, then returning that user to the frontend
  • y

    YelloJello

    07/27/2021, 7:10 PM
    sry had something come up, if you're returning the user object after calling it in the server-side then why are you trying to get that same user object again?
  • f

    frubalu

    07/27/2021, 7:11 PM
    no worries! i'm actually returning a user from a separate
    public.users
    table, instead of the
    auth.users
    table
  • f

    frubalu

    07/27/2021, 7:11 PM
    like i said, everything else works, but for some reason the
    signIn()
    method isn't actually setting the session
  • y

    YelloJello

    07/27/2021, 7:13 PM
    to get the additional user data, you'd need the user's id right? you can get the user's id from the data that the mutation returns right?
  • f

    frubalu

    07/27/2021, 7:13 PM
    oh, are you asking why i'm trying to run
    const session = supabase.auth.session()
    inside of a useEffect in the first place?
  • y

    YelloJello

    07/27/2021, 7:13 PM
    basically what im trying to say is that since you're calling signIn() in the server, the fact that session is null in the client is valid
  • y

    YelloJello

    07/27/2021, 7:14 PM
    because you never called signIn() in the client
  • f

    frubalu

    07/27/2021, 7:14 PM
    true, i suppose that makes sense. i figured since they're same-origin (it's not a decoupled backend), i could still return session
  • f

    frubalu

    07/27/2021, 7:15 PM
    would you happen to know of a way i could manually set session? i know there's a
    setSession
    method in @supabase/gotrue-js/src/GoTrueClient.ts, so maybe I could try messing around with that if it's available
  • y

    YelloJello

    07/27/2021, 7:16 PM
    nah that's not how it works, and i'd say what you're doing is pretty counter-intuitive
  • f

    frubalu

    07/27/2021, 7:16 PM
    dangit
  • y

    YelloJello

    07/27/2021, 7:16 PM
    does the supabase lib expose that method?
  • f

    frubalu

    07/27/2021, 7:16 PM
    i'm not entirely sure just yet
  • y

    YelloJello

    07/27/2021, 7:17 PM
    it probably does, take a look at the shape of the function and see what you need, then work your way from there
  • f

    frubalu

    07/27/2021, 7:17 PM
    would you have a suggestion on a better way to handle serverSide auth (high-level)?
  • f

    frubalu

    07/27/2021, 7:18 PM
    no worries if not, that's kind of a big ask haha
  • y

    YelloJello

    07/27/2021, 7:18 PM
    i guess you're using nextjs?
  • f

    frubalu

    07/27/2021, 7:18 PM
    yep
  • f

    frubalu

    07/27/2021, 7:18 PM
    i'm taking a look at this: https://github.com/vercel/nextjs-subscription-payments/tree/main/pages
  • f

    frubalu

    07/27/2021, 7:19 PM
    but i'm noticing that he runs those signin methods on the frontend
  • y

    YelloJello

    07/27/2021, 7:19 PM
    do it the traditional way, with cookies and ssr -> https://github.com/supabase/supabase/tree/master/examples/nextjs-auth
  • y

    YelloJello

    07/27/2021, 7:19 PM
    nade has written an article about this too, let me get it for you https://dev.to/dabit3/magic-link-authentication-and-route-controls-with-supabase-and-next-js-leo he goes over how to do it with magic-link, but it still applies to all the other providers
  • s

    sumchans

    07/27/2021, 7:20 PM
    Hello all, new member here. Blocked with something, does anybody have issues creating buckets using supabase dashboard?
  • s

    sumchans

    07/27/2021, 7:20 PM
    I get the message An internal error has occured
  • f

    frubalu

    07/27/2021, 7:21 PM
    thanks a ton, i'll get to reading!
  • b

    bdlukaa

    07/27/2021, 7:21 PM
    can I check if a table exists? (from client lib)
  • y

    YelloJello

    07/27/2021, 7:24 PM
    try again maybe, I just created one with no issues, report it if it continues
  • s

    sumchans

    07/27/2021, 7:24 PM
    @User Been trying since yesterday, I keep getting the same message.
1...789...316Latest