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

    Null

    01/03/2022, 10:34 PM
    Im assuming the local storage?
  • m

    Mac

    01/03/2022, 10:52 PM
    Perhaps you could use
    getSession
    instead. That way you'd be able to access both the access token and the user data:
    Copy code
    js
    const { access_token, user } = supabase.auth.session();
  • n

    Null

    01/03/2022, 10:54 PM
    Exactly what I was lookin for thanks! I literally just went ahead and did
    const test = JSON.parse(localStorage.getItem("supabase.auth.token"));
  • n

    Null

    01/03/2022, 10:55 PM
    Lol
  • n

    Null

    01/03/2022, 10:55 PM
    getSession is much better
  • h

    Hhorn

    01/03/2022, 11:57 PM
    I‘ve got one question. I wanna support signing in on a second device by scanning a qr code with the loggedIn device. With Firebase Auth I was able to generate a custom token serverside to log in on the seconde device. Is there such a feature in supabase (which I didn‘t find)? Thanks for any help
  • t

    thisisgoldman

    01/04/2022, 12:13 AM
    I'm trying to subscribe to realtime updates to a table that is not in the
    public
    schema. The table I'm trying to subscribe to is in a schema called
    stripe
    Here is how I set up the subscription:
    Copy code
    js
    const subscription = supabase
            .from(`stripe.subscription`)
            .on("UPDATE", (payload) => {
              setUser({ ...user, ...payload.new });
            })
            .subscribe();
    It doesn't appear to work. It looks like it prepends to the public schema. Any feedback or advice?
    g
    • 2
    • 3
  • t

    thisisgoldman

    01/04/2022, 12:29 AM
    Realtime on tables in non-public schema
  • r

    robotdood

    01/04/2022, 3:52 AM
    I'm running into errors inside my
    create_profile_for_user
    Postgres function when I try to access the
    user_metadata
    object on my newly signed up user. My
    profiles
    table has a
    username
    column (text) and my Postgres function looks like this:
    Copy code
    begin
      insert into public.profiles(id, username);
      values(new.id, new.user_metadata.username);
      
      return new;
    end;
    I'm adding
    user_metadata
    as per the docs: https://supabase.com/docs/reference/javascript/auth-signup#sign-up-with-additional-user-meta-data I know the data is successfully passed to the function because I can set
    username
    to
    new
    (instead of
    new.user_metadata.username
    or
    new.data.username
    or
    new.username
    or other similar attempts) and I get something like this entered into the
    username
    cell:
    Copy code
    (00000000-0000-0000-0000-000000000000,3a8b9bf6-3313-4ad6-b67f-8b9eb97f5874,authenticated,"",test@email.com,$2a$10$tXkm/RwqkSgKwuy5QbvCGuwRjuSSrU/YVus.4VkwNzIbAB5.OKhyO,,,"",,"",,"","",,,"{""provider"": ""email"", ""providers"": [""email""]}","{""username"": ""my cool username""}",f,"2022-01-04 03:39:06.055591+00","2022-01-04 03:39:06.055591+00",,,"","",,,"",0)
    I'm new to Postgres, but I figure my attempt to access
    user_metadata
    with dot notation is what's failing me, does that sound right?
    • 1
    • 2
  • r

    robotdood

    01/04/2022, 5:12 AM
    user_metadata
    in Postgres function
  • a

    Alf

    01/04/2022, 7:28 AM
    Hey there, a quick question. Is there a way for chaining
    ilike
    when querying a table? In my case I have a text field of pipe-separated categories and I would like to look for all the rows that contain one or multiple categories, so I'd need to use multiple `ilike`s
    s
    • 2
    • 3
  • r

    rveciana

    01/04/2022, 10:28 AM
    Hello, I don't know if someone else has faced this problem: I add a schema in Settings->API->Settings->Schema (stations was already there, adding seismology) When trying to access it using the Javascript client, I still get the message: message: 'The schema must be one of the following: public, storage, stations' Do I have to do something else, beside adding it there? The database persmissions are also added for 'anon'
    s
    t
    • 3
    • 9
  • v

    Varna

    01/04/2022, 2:37 PM
    Maybe someone has some experience to share about using supabase together with mobx?
    s
    • 2
    • 2
  • s

    Scott P

    01/04/2022, 2:48 PM
    Supabase + MobX
  • c

    codingwithmanny

    01/04/2022, 2:54 PM
    I realize there's an email support on the website, but does Supabase have a faster way to get in contact with Sales? Looking to use Authentication service for a larger volume of users.
  • k

    Kellen Mace

    01/04/2022, 2:59 PM
    Does anybody know if it's possible to enforce strong passwords on the server using Supabase email / password auth? Example: A new user is trying to register an account and set "abc123" as their password. The request should return an error response, and a new account should not be created. Maybe password validation code could be run inside of a serverless function or something? I'm using the Supabase JavaScript client library.
    a
    m
    • 3
    • 7
  • a

    Anoushk

    01/04/2022, 3:26 PM
    How to preserve auth on frontend?
  • a

    Anoushk

    01/04/2022, 3:26 PM
    When I refresh the user doesn’t exist anymore
  • a

    andyouareagone

    01/04/2022, 3:53 PM
    Backend-code
  • m

    marcelcruz

    01/04/2022, 5:46 PM
    hey folks. I just increased the
    Max Rows
    value on my project's settings, but
    select
    is still capped at 1.000. does this change take some time to propagate or something? thanks! edit: it seems there's already an open issue on this matter: https://github.com/supabase/supabase/issues/4544
  • d

    dhruv_casa

    01/04/2022, 6:27 PM
    I applied for Google brand verification because I want my own domain to show up instead of Supabase domain, and they rejected my request because I'm using Supabase (gfe...) as the redirect URL. How do I fix this so I can use my website URL?
    m
    s
    s
    • 4
    • 8
  • w

    wiesson

    01/04/2022, 6:39 PM
    I have a slightly larger checkout form with a lot of relations and options - I had no issue to get the tasks done, but it looks like a mess 😅 - does anyone know a good open source example where I can have a look how to structure big forms with a lot of joins / options? (Ideally next/react/ts).
  • w

    wiesson

    01/04/2022, 6:41 PM
    I'm also interested in this 👆
  • s

    StickSeas

    01/04/2022, 6:47 PM
    Hello Supabase Community. I'm using email auth and I wanted to know if it's possible to log every user out of my app at once from app.supabase.io. I can't seem to find a way.
  • n

    Nick

    01/04/2022, 7:30 PM
    hey folks. How would I go about modeling a "site license" in supabase/postgres? That is, a license which is valid for any user in the users table whose email matches
    *@whatever.com
    ?
    k
    • 2
    • 9
  • n

    Nick

    01/04/2022, 7:31 PM
    it seems to me this condition should be evaluated at query time, otherwise the data would need to be rewritten every time a new user signs up
  • r

    robotdood

    01/04/2022, 8:41 PM
    Is there a way to have a
    slug
    column that auto slugifies the value of another column on
    INSERT
    and/or
    UPDATE
    ? I attempted to add this function, but am unable to set the return type to `trigger`: https://www.kdobson.net/2019/ultimate-postgresql-slug-function/ Another option I saw in the comments of the gist (linked at bottom of that blog post) was to have a generated column a la:
    Copy code
    CREATE TABLE person (
      name  text not null,
      slug  text generated always as (slugify(name)) stored
    );
    Not sure how to create a generated column within Supabase, though. Any ideas?
    s
    j
    • 3
    • 16
  • k

    ktosiek

    01/04/2022, 9:18 PM
    Site license, and read vs write workloads
  • n

    Nick

    01/04/2022, 9:55 PM
    hmm separate question: does supabase or postgres have any idea of a get-or-create function?
    s
    • 2
    • 9
  • a

    AmusedGrape

    01/04/2022, 11:23 PM
    I have an additional redirect URL added to my project, however once the OAuth flow is completed, it just redirects to the main site url (blacked out) instead of the additional URL that it came from. Am I doing something wrong?
    s
    • 2
    • 2
1...183184185...316Latest