https://supabase.com/ logo
Join DiscordCommunities
Powered by
# javascript
  • l

    larryM

    09/18/2021, 1:54 AM
    has anyone created an otp pin system with using verification by Email vs. Phone?
  • s

    Scott P

    09/18/2021, 2:23 AM
    I asked about this some time before phone auth was added, and the response I got was that phone auth was the first step, and OTP would be a possibility later on. It's already sort of possible to build your own, but it doesn't link in directly with auth - it essentially involves logging the user out if they fail OTP, so it's a front-end hack and wouldn't be something I'd recommend
  • l

    larryM

    09/18/2021, 2:34 AM
    thanks @User - we were considering building one ourselves but to your point, it might be too much to manage, (especially if they plan to ship it in the near future)
  • m

    mtallalazam

    09/18/2021, 6:37 PM
    Hi, everyone. Can anyone help me regarding types for typescript of User object returned after authentication process?
  • d

    davitykale

    09/18/2021, 10:02 PM
    Has anyone come across the "Error getting session from URL." in an Expo/React Native project? I see the error as soon as I create a Supabase client and I am no longer to do anything with Supabase in my application.
  • s

    stibbs

    09/18/2021, 10:10 PM
    Are you sure your URL (probably in
    .env.local
    or similar) is correct?
  • s

    stibbs

    09/18/2021, 10:11 PM
    https://github.com/supabase/gotrue-js/blob/master/src/lib/types.ts
    Copy code
    typescript
    export interface User {
      id: string
      app_metadata: {
        provider?: string
        [key: string]: any
      }
      user_metadata: {
        [key: string]: any
      }
      aud: string
      confirmation_sent_at?: string
      recovery_sent_at?: string
      action_link?: string
      email?: string
      phone?: string
      created_at: string
      confirmed_at?: string
      email_confirmed_at?: string
      phone_confirmed_at?: string
      last_sign_in_at?: string
      role?: string
      updated_at?: string
    }
  • d

    davitykale

    09/18/2021, 10:19 PM
    Yup! Super sure. This has happened to me on two separate Expo projects using Supabase -- I set everything up (copying the set up from the expo-todo-list example), everything works for a bit, I log in and out a few times, and then eventually reach this error and am stuck.
  • m

    mtallalazam

    09/19/2021, 1:09 AM
    Thanks a lot. I also found out that the type for user is exported from "@supabase/supabase-js" as "AuthUser".
  • s

    shahpriyansh04

    09/22/2021, 4:37 AM
    How can we push new data in a row of type json array without affecting the previous data ? For eg. I have the data as follows
    Copy code
    [{id: '1" , name: "John Doe"}]
    So how can i make it like this
    Copy code
    [{id: '1" , name: "John Doe"} , {id: "2" , name: "Jane Doe"}]
    Can anyone pls help with this ?
  • s

    stibbs

    09/22/2021, 7:29 AM
    This is for supabase specific questions fyi. But I think what you are looking for is
    Copy code
    ts
    const arrayName = [{id: '1', name: 'John Doe'}]
    arrayName.push(...[{id: '2' , name: 'Jane Doe'}]);
    console.log(arrayName)
    // [{id: '1', name: 'John Doe'}, {id: '2' , name: 'Jane Doe'}]
  • s

    stibbs

    09/22/2021, 7:41 AM
    Should something like this work?
    Copy code
    ts
    await supabase
      .from('posts')
      .update({ valid_until: `now() + interval '30 day'` })
      .eq('id', postId);
    valid_until
    is of type
    timestamp with time zone
    Edit: It would appear not... What's the best way to achieve this?
    Copy code
    json
    {
      "hint": null,
      "message": "invalid input syntax for type timestamp with time zone: \"now() + interval '30 day'\"",
      "code": "22007",
      "details": null
    }
    s
    • 2
    • 2
  • s

    stibbs

    09/22/2021, 7:49 AM
    Doing
    .update({ valid_until: 'now()'})
    works... but the psql datetime operator won't?
  • s

    shahpriyansh04

    09/22/2021, 12:10 PM
    Thank you for your response Will definitely try it out
  • s

    silentworks

    09/22/2021, 4:29 PM
    Timestamp with later date in update function
  • m

    MikeJ

    09/22/2021, 4:34 PM
    Is there a method to get the URL the supabase client will fetch, but not actually make the fetch? e.g. for supabase .from("statements") .select("*") .eq("poll_id", pollId); I would like to return "https://my.supabase.co/rest/v1/statements?select=*&poll_id=eq.967065f5-1145-45da-865d-246bc719a6fc" The reason I want this is there are some URLs I want to prefetch in my like:
  • a

    Angelu

    09/23/2021, 2:05 PM
    Hi everyone, before can I use
    Copy code
    client.from('table_name').on('INSERT', (data) => {
      console.log(data)
    }).subscribe()
    do I need to install the
    @supabase/realtime-js
    ? Cause I'm inserting something in my database but nothing on my console.
  • s

    Scott P

    09/23/2021, 3:11 PM
    No - the
    @supabase/supabase-js
    library includes support for all client-facing features of Supabase. Make sure you've enabled subscriptions for the table you're subscribing to (check the Database > Replication page in the dashboard)
  • a

    Angelu

    09/24/2021, 12:25 PM
    Thanks @User it's working now...
  • l

    liljamesjohn

    09/24/2021, 2:46 PM
    How do I access my database via Next.js API when using RLS?
  • p

    patrik

    09/24/2021, 2:56 PM
    there are a couple of nextjs examples here: https://github.com/supabase/supabase/tree/master/examples
  • l

    liljamesjohn

    09/24/2021, 2:58 PM
    None of them query the database via api routes though
  • d

    discoding

    09/24/2021, 3:50 PM
    hey everyone, does anyone know why is supabase including a
    #
    at the end of my
    redirectTo
    url?
    s
    • 2
    • 3
  • s

    silentworks

    09/24/2021, 8:51 PM
    Why is supabase including a hash at the end of redirectTo
  • d

    discoding

    09/25/2021, 7:32 AM
    Hey everyone, how do i get the accesstoken of a user after the user clicks the magic link and redirects to the site?
  • d

    discoding

    09/25/2021, 7:32 AM
    Thank you.
  • d

    discoding

    09/25/2021, 7:33 AM
    I'm first redirecting to my API route to the cookie and then send it to the page
  • j

    Jaeden

    09/25/2021, 8:06 AM
    Hi all 🤘! Working on my app in Nuxt (first app ever, its exciting and scary) And I need to count the amount of visitors on each profile page. I’m migrating from Firebase. And they have a counter with sharding on Cloud Functions. 1. How many writes a second can Supabase handle? 2. Any ideas on the best way to implement this? Do you set like a 30min cookie as session and increment the page view? 3. Very new to Supabase and Postgres so love to get any pointers on incrementing a “Visitors” column. And if you can do so at scale
  • j

    Jaeden

    09/25/2021, 2:37 PM
    I figured it out with this guide; https://codebycorey.com/blog/page-views-nextjs-supabase
  • a

    Adnane

    09/27/2021, 2:15 PM
    Hello, anyone have a stack Redux + Supabase ?
    k
    • 2
    • 2
1...212223...81Latest