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

    ! Class self.PythonAddict = True

    07/27/2021, 4:40 PM
    Yea First msg in #869406062036529193
  • e

    eyeschico

    07/27/2021, 6:55 PM
    console.log(β€˜hello everyone !’)
  • f

    Flyken

    07/27/2021, 8:43 PM
    @User its logging each time, not as an array
  • f

    Flyken

    07/27/2021, 8:43 PM
  • c

    ctrl-raul

    07/28/2021, 1:51 AM
    A separate channel for TypeScript perhaps
  • j

    Jacob Paris πŸ‡¨πŸ‡¦

    07/28/2021, 3:52 AM
    it's often best to keep channels as tight as possible in new communities
  • j

    Jacob Paris πŸ‡¨πŸ‡¦

    07/28/2021, 3:52 AM
    tons of granular channels make a place look like a ghost town
  • j

    Jacob Paris πŸ‡¨πŸ‡¦

    07/28/2021, 3:52 AM
    until you have enough activity to fill it up
  • c

    copple

    07/28/2021, 4:32 AM
    Agreed, this split was a bit premature but I'll keep it like this for now. The discord is filling up fast
  • u

    user

    07/28/2021, 10:48 AM
    Hi everyone πŸ‘‹πŸ½ I'm looking to implement a way for users to edit their email. I'm using the following code snippet from the docs (please see image attached) However, when performing this operation, I've observed a couple of things: - The new email that is set is stored under the property new_email, as opposed to overwriting the original email - The new email does not reflect in the Users dashboard in Supabase My question is: is this normal? I feel like it is a little confusing as the new email doesn't reflect in the users dashboard πŸ€” Let me know if I'm doing something wrong though, appreciate any guidance πŸ™‚ Thanks!
  • s

    stibbs

    07/28/2021, 11:48 AM
    Hi! I'm teaching myself JS/TS with Nextjs alongside learning supabase, so hopefully this question makes sense! I have a "settings" table with row level security restricting access to select/insert/update only their own rows (via uid). I have a settings page with a form in Nextjs. It can write to the db. I'm now trying to have it populate with any existing saved settings. I think I need to do this via a nextjs api and SWR. I've created a very simple API and can access the user's session (via
    req.headers.token
    ) but don't know how to get from that back to their uid so I satisfy the RLS? I followed a guide recently to do a similar thing in firebase and it had a firebase auth-admin function called
    verifyIdToken
    ... is there an equivalent? Or am I going about this all wrong, in which case please point me in the right direction πŸ™‚
  • b

    burggraf

    07/28/2021, 12:57 PM
    I believe this code you referenced is only for updating the metadata part of the user record, and not to update the email address.
  • u

    user

    07/28/2021, 12:58 PM
    Ah this makes more sense thanks @User - do you know if its possible for someone to update the email they signed up with?
  • b

    burggraf

    07/28/2021, 12:59 PM
    Yes it's possible. I believe you just need to modify the auth.users.email field. I don't know if we have any examples of this, I'll look. But if not, you can create a Postgres function to do it pretty easily.
  • u

    user

    07/28/2021, 1:00 PM
    Yeah that makes sense, I can get a function written like this. Thanks for the help @User !
  • b

    burggraf

    07/28/2021, 1:05 PM
    Just be sure to be aware of the security problems with this. A user could try to change their email to someone else's email, such as
    president@whitehouse.gov
    . So don't allow the change to live until the user verifies their email address. πŸ™‚
  • u

    user

    07/28/2021, 1:06 PM
    Of course πŸ™ŒπŸ½ Thanks for pointing this out!
  • b

    burggraf

    07/28/2021, 1:08 PM
    This page seems to indicate you can change email with the
    update()
    method, and that it will send a confirmation email automatically, but this may be old documentation so you might want to test this: https://supabase.io/docs/gotrue/client/update
  • u

    user

    07/28/2021, 1:09 PM
    Thank you very much πŸ˜„
  • b

    burggraf

    07/28/2021, 1:10 PM
    let me know if this work --- I hope it does work, as I would like to use this too! I haven't gotten around to offering "update email address" functionality yet, but it's on my list πŸ™‚
  • u

    user

    07/28/2021, 1:11 PM
    I will do!
  • v

    vblinden

    07/28/2021, 1:32 PM
    Is there any way to make a distinct call using the JS client?
  • b

    burggraf

    07/28/2021, 2:10 PM
    What do you mean by
    a distinct call
    ?
  • s

    silentworks

    07/28/2021, 2:30 PM
    Normally used to get only one distinct copy of a result https://www.w3schools.com/sql/sql_distinct.asp
  • s

    silentworks

    07/28/2021, 2:32 PM
    This is probably not possible from the JS client at the moment but you can create a View or stored function that does this.
  • b

    burggraf

    07/28/2021, 2:35 PM
    Ah, the old
    select distinct
    ! Yeah at this time you need to write a
    view
    or a
    function
    for that and call it with
    .rpc()
  • a

    a d

    07/28/2021, 2:44 PM
    im using this code example to create a bucket in supabase but when i visit the website i don't see any bucket formed
    Copy code
    js
    const { data, error } = await supabase
        .storage
        .createBucket('avatars', { public: false })
  • a

    a d

    07/28/2021, 2:44 PM
    am i doing something wrong
  • v

    vblinden

    07/28/2021, 2:57 PM
    This is what I meant indeed. Should have formed my question a little better. Thanks for the clarification.
  • v

    vblinden

    07/28/2021, 2:57 PM
    Ah ok! Thanks. Any plans to include this in the library?
12345...81Latest