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

    yourfriend

    11/08/2021, 6:38 PM
    passing
    undefined
    for a value of an object to be upserted doesn't seem to translate to upserting as NULL (as you might expect?) instead it doesn't bother trying to use that key value pair and so i was getting the
    All object keys must match
    error
    s
    i
    • 3
    • 8
  • y

    yourfriend

    11/08/2021, 6:39 PM
    2lazy to write a github issue but hopefully this helps someone if they're searching discord
  • m

    Mike92988

    11/08/2021, 9:18 PM
    any suggestions on how to convert a date to milliseconds in an sql query on supabase?
  • s

    Scott P

    11/08/2021, 9:41 PM
    To convert from Unix timestamp to datetime:
    SELECT to_timestamp(<epoch time>);
    To convert from datetime to Unix timestamp in ms:
    SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE '<date time>')
    (Search for 'epoch' on this page for more details and examples: https://www.postgresql.org/docs/9.2/functions-datetime.html) Side note: Anything regarding SQL should go in the #869405720934744086 channel instead
  • x

    Xzeta

    11/10/2021, 2:15 AM
    how would one to many work? If i want to get a storypost along with its comments
    s
    • 2
    • 2
  • s

    Scott P

    11/10/2021, 2:26 AM
    Selecting related tables
  • h

    hoesmean

    11/10/2021, 12:47 PM
    #869406062036529193 Hey Guys, how to imlement upload and get image?
    s
    • 2
    • 3
  • s

    silentworks

    11/10/2021, 12:57 PM
    How to upload and get image
  • x

    Xzeta

    11/10/2021, 7:59 PM
    Any reason why it says Can't perform a React state update on an unmounted component for this.
    Copy code
    useEffect(() => {
        const fetchJobs = async () => {
          setLoading(true);
          setErrorMessage(false);
          try {
            const { data, error } = await supabase.from("jobs");
    
            if (error) throw error;
            setJobs(data);
          } catch (error) {
            setJobs(null);
            setErrorMessage(true);
          } finally {
            setLoading(false);
          }
        };
        fetchJobs();
        // return () => fetchJobs();
      }, []);
    c
    • 2
    • 13
  • e

    egnus

    11/10/2021, 8:29 PM
    Maybe missing
    .select('*')
    ?
  • x

    Xzeta

    11/10/2021, 9:24 PM
    oh i still have the select but same error
  • c

    chipilov

    11/10/2021, 10:22 PM
    React state update on unmounted component
  • t

    Terry

    11/10/2021, 11:18 PM
    In my NextJS app, I want a "Request to Chat" button. To do this, I already have the users id, but not their email address. I currently have it setup to query for their email and then send an email to that address via SendGrid.
  • t

    Terry

    11/10/2021, 11:18 PM
    But, this involves passing the email address through the client.
  • t

    Terry

    11/10/2021, 11:19 PM
    Anyone think of a way I could use a next api route to send an email without passing the email through the client?
  • m

    Mike92988

    11/11/2021, 3:11 PM
    Getting an error when trying to update a row with the library: "invalid input syntax for type bytea" not sure what that means though
    s
    • 2
    • 4
  • i

    isaiah

    11/12/2021, 6:48 AM
    Say, pals, what's the best practice right now doing client-side route protection, given that Auth.useUser() initially returns identical values for both the logged-in and logged-out case?
    c
    • 2
    • 13
  • i

    isaiah

    11/12/2021, 6:52 AM
    I've found about 1,000 people complaining that
    supabase.auth.user()
    doesn't return a promise, across stackexchange, github, reddit, and this discord. It's totally unintuitive, and it makes it massive headache to implement auth flows that should be trivial. Doesn't look like Supabase has plans to change it, though. Anyone got a favorite solution?
  • c

    chipilov

    11/12/2021, 8:04 AM
    Access to Auth.user()
  • s

    Sleighty

    11/12/2021, 8:51 AM
    testing out Supabase auth and found something odd, wondering if somebody could enlighten me. if I call supabase.auth.signUp with an existing email address, I get an object full of user data including:
    id
    ,
    aud:authenticated
    ,
    role:authenticated
    , the email address,
    email_confirmed_ad
    ,
    phone
    , and other bits of data. is that normal? doesn't that give anyone ability to see 1) who's registered in my app, 2) their phone numbers, 3) their last login date, and who knows what else? I would expect to get an error "email already registered" like in firebase maybe?
  • c

    chipilov

    11/12/2021, 9:23 AM
    Great find, @User - I recommend you contacted security@supabase.io ASAP (more info about reporting security issues to the Supabase team: https://github.com/supabase/supabase/security/policy)
  • c

    chipilov

    11/12/2021, 9:39 AM
    btw, it sounds to me that Firebase's behavior is also NOT ideal, because it still leaks info about whether a user is registered or not...
  • y

    YelloJello

    11/12/2021, 9:40 AM
    haha nice, this is something I found out just yesterday and I was weirded out by it. supabase doesn't throw any error if a user with a particular email already exists, but i kinda remember it throwing an error some time back
  • y

    YelloJello

    11/12/2021, 9:42 AM
    so it could just be the fact that some time back someone messed up, because for example the email confirmations aren't sent, the auth.users row for the user isn't updated
  • s

    Sleighty

    11/12/2021, 9:45 AM
    true but at least saying an email is already taken is pretty common practice
  • y

    YelloJello

    11/12/2021, 9:46 AM
    https://github.com/supabase/supabase-js/issues/296
  • y

    YelloJello

    11/12/2021, 9:46 AM
    So i guess they did make the change recently
  • s

    Sleighty

    11/12/2021, 9:46 AM
    what’s weird about this behavior is that i don’t even know what to tell such a user. if a legitimate user is trying to create an account with an existing email, it seems impossible to differentiate supabase.auth.signUp’s response for 1) a user who successfully signed up but needs to confirm their email, or 2) a user who forgot they already had an account and needs to actually sign in
  • s

    Sleighty

    11/12/2021, 9:46 AM
    oh nice i’ll look into that issue
  • y

    YelloJello

    11/12/2021, 9:47 AM
    apparently it's just fake data that's returned when you call auth.signUp()
1...303132...81Latest