https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • `generateLink` doesn't send emails when updating user email address
    d

    dayvista

    03/20/2023, 12:03 AM
    I'm calling the functions here to "Generate links to change current email address" and no email is getting sent. I tried: - Custom SMTP - The default SMTP - Calling both functions together vs. calling one or the other - Using the
    redirectTo
    option It seems like no emails have been sent after 10+ attempts. Is there something I'm missing?
    w
    • 2
    • 5
  • How to check the email OTP?
    s

    staya

    03/20/2023, 1:01 AM
    So I built this simple svelte auth component using guide here https://supabase.com/docs/guides/getting-started/tutorials/with-svelte. But I also want to give user the ability to just enter the code
    {{ .Token }}
    sent in the email so they don't need to click the link in the inbox. Type seems to support this, but I'm not sure how do I rewrite the function? Do I check if the code var exists and then pass it with
    signInWithOtp({})
    ? That don't seem to be expected...
    g
    • 2
    • 3
  • Self-Hosting Without Docker? - Looking to host on OpenBSD
    c

    Cybear

    03/20/2023, 1:32 AM
    I was wondering if it is possible to self host Supabase without the use of Docker? I am particularly looking to run it on OpenBSD. Any info would be greatly appreciated.
  • Deno environment on edge functions missing globals?
    i

    imagio

    03/20/2023, 1:39 AM
    When I try to run my edge functions via
    supabase funcions serve
    they crash when any code accesses some node globals such as
    performance.now()
    . They crash because the global
    performance is undefined
    The strange thing is that the same code works perfectly fine when running locally with
    deno run -A ./my_code.ts
    . It's only the edge runtime that for some reason seems to be missing Deno builtin globals like
    performance
    . Am I missing something? Is this a bug in the edge runtime? It it expected but just not documented? Any pointers would be appreciated, thanks!
    m
    • 2
    • 2
  • v1.2.0 not available
    n

    NinjaNuur

    03/20/2023, 5:59 AM
    Hi, I want to use the new string filters (e.g. startsWith). Any idea when this will be available in existing supabase projects?
    g
    • 2
    • 1
  • `db diff` doesn't work!
    a

    Amr

    03/20/2023, 6:01 AM
    When I run this command
    supabase db diff --use-migra
    I get a long error (attached). My supabase CLI:
    1.42.7
    I disabled
    ufw
    , but still no difference.
    • 1
    • 2
  • GraphiQL data explorer?
    j

    jt

    03/20/2023, 6:14 AM
    Any plans to implement a data explorer ala Hasura to visually build queries?
  • Gitpod setup
    h

    H1net

    03/20/2023, 11:39 AM
    Is there any additional configuration required for docker to make this work on gitpod? People seem to be reporting that they're happily using gitpod but I get the error I've attached, when trying to run
    Copy code
    supabase start
  • "This Project does not exist"
    e

    eimenhmdt

    03/20/2023, 12:15 PM
    Hey guys, during the last hour I'm constantly getting the error "This project does not exist" on the supabase cloud platform. I'm signed in and my account is in good standing. What might be the reason?
    n
    • 2
    • 2
  • Server-side callback when user registers/logs in
    j

    joaquimley

    03/20/2023, 12:20 PM
    In my use case, I have both Supabase running as well as an express app (for business reasons edge functions is not enough). I'm fine not being the one generating the JWT but it would be helpful to get a some sort of callback when a user first registers their account and/or when they login. I understand there are webhooks and functions but, not only they are in ALPHA stage but I would preferably not open a route (endpoint) for this usecase. DB functions would not scale for this specific use case either. I'm wondering if subscribing to the users table is the optimal way to go or it would consuming too many resources since the server instance(s) would be taking a connection. The way I see it, the webhook is probably the best approach but would love to hear other opinions.
    n
    • 2
    • 14
  • Operation is not permitted on predefined host network
    a

    ack210

    03/20/2023, 12:37 PM
    Hi all, Wondering if anyone has run into a similar issue when attempting to use
    supabase db remote commit
    to pull down changes from the remote db. When running this command, I receive the following error: > Error: Error running pg_dump on remote database: Error response from daemon: operation is not permitted on predefined host network I've tried resetting docker to factory defaults and still no luck, and not really sure what to do to troubleshoot further. I have Docker Desktop for Windows (using WSL 2). I've also attached the full output when using the
    --debug
    flag with the command. Thanks for any help!
  • state management pattern with nextjs13 and supabase
    r

    Razoth

    03/20/2023, 2:09 PM
    I wonder what the correct way to do this is. i haven't found much information on how to persist state from the provider hooks and make it persist. react apps forget all the context on reload, so if the local state changes and its something i want to persist, like darkmode/lightmode or prefered language, what would be right pattern to do this with supabase and nexjts?
    n
    c
    • 3
    • 10
  • redirectTo is not working with resetPasswordForEmail()
    l

    Lukas V

    03/20/2023, 2:48 PM
    Hello, I am using this resetPasswordForEmail() like this:
    Copy code
    const { error } = await supabaseClient.auth.resetPasswordForEmail(
          data.email,
          {
            redirectTo: `${getURL()}/reset-password`
          }
        );
    However, when i receive email link, I am logged in and redirected to home page instead of
    reset-password
    j
    g
    • 3
    • 4
  • Flutter Google Login
    n

    nitishk72

    03/20/2023, 2:51 PM
    I am working with Supabase auth, I was trying to login using Google. I am not sure why it's not working I am getting this error
    Copy code
    json
    {
      "message":"No API key found in request",
      "hint":"No `apikey` request header or url param was found."
    }
    g
    v
    • 3
    • 5
  • How To Get SuperUser Role
    p

    PGF_GAMING

    03/20/2023, 2:54 PM
    I am currently the Owner of my project and I am trying to run my sql file from my cmd psql but its throwing this error: psql:db.sql:2401: ERROR: permission denied to create event trigger "issue_graphql_placeholder" HINT: Must be superuser to create an event trigger. ALTER EVENT TRIGGER psql:db.sql:2412: ERROR: permission denied to create event trigger "issue_pg_cron_access" HINT: Must be superuser to create an event trigger. ALTER EVENT TRIGGER psql:db.sql:2423: ERROR: permission denied to create event trigger "issue_pg_graphql_access" HINT: Must be superuser to create an event trigger. ALTER EVENT TRIGGER psql:db.sql:2434: ERROR: permission denied to create event trigger "issue_pg_net_access" HINT: Must be superuser to create an event trigger. ALTER EVENT TRIGGER psql:db.sql:2444: ERROR: permission denied to create event trigger "pgrst_ddl_watch" HINT: Must be superuser to create an event trigger. ALTER EVENT TRIGGER psql:db.sql:2454: ERROR: permission denied to create event trigger "pgrst_drop_watch" HINT: Must be superuser to create an event trigger. ALTER EVENT TRIGGER It's saying I am not a superuser so, how can I be a superuse
    g
    • 2
    • 2
  • createClient error
    d

    DisamDev

    03/20/2023, 3:03 PM
    When I start my app I get the following error:
    g
    • 2
    • 2
  • wekbooks don't work locally
    f

    FilippoBrigati

    03/20/2023, 3:11 PM
    Hi, I'm trying to create a webhook in my local development environment, but when I try I get this error and I don't know how to fix it, someone can help me?
  • pg_cron alter_job fails when called with authenticated user
    k

    KirioXX

    03/20/2023, 3:35 PM
    Hi, I try to setup a cron job from my app but when I try to call alter_job I get a permission denied error. The RLS functions seam to be correct and the schedule function works fine. Is there something I could have missed that blocks authenticated user from altering a job?
    g
    • 2
    • 14
  • Verify/validate a session token from C#?
    g

    GurkanG

    03/20/2023, 4:31 PM
    I've got a microservice built on C# where I would like to verify requests from the FE application to check if the user is both authenticated and authorized to interact with this microservice. What I would like to do is to send the current sessions access token from the FE application to the microservice, where it verifies the token and the user by calling the Supabase auth endpoint and basically checking
    isValidToken(token)
    . But I'm unsure how to access this from my C# code. I haven't been able to find out if I can directly call auth endpoints of my Supabase instance, like for instance
    /verifyToken
    (or similar). Do I need to build a "translation service" that uses the official libraries so I can use something like
    supabase.auth.api.getUser('ACCESS_TOKEN_JWT')
    which returns if if there is an active session. I haven't been able to find an equivalent solution in the C# community library. Is there a better/easier way to solve this problem?
    n
    g
    b
    • 4
    • 9
  • supabase.storage.remove() not functioning when called
    e

    Entropy

    03/20/2023, 4:44 PM
    Hello! I'm trying to use .remove() but when I call it nothing happens. No data or errors are logged when I call it. I checked to make sure I had my rls setup and everything looks good to me at least. Any help would be much appreciated! Code:
    Copy code
    ts
    const { data, error } = await supabase.storage
      .from('avatars')
      .remove([`${user.id}/small.png`, `${user.id}/medium.png`, `${user.id}/large.png`])
    Delete Policy (authenticated):
    Copy code
    sql
    ((bucket_id = 'avatars'::text) AND ((storage.foldername(name))[1] = (auth.uid())::text))
    g
    • 2
    • 10
  • PG foreign data wrapper using scan instead of indexes...how to fix?
    z

    zachblume

    03/20/2023, 4:49 PM
    Hi! I have a foreign table defined this way:
    Copy code
    -- Create foreign data wrapper to fec
    CREATE EXTENSION postgres_fdw;
    GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO postgres;
    CREATE SERVER fec FOREIGN DATA WRAPPER postgres_fdw OPTIONS (
      host '...hostname...',
      port '5432',
      dbname 'postgres'
    );
    CREATE USER MAPPING FOR postgres SERVER fec OPTIONS (
      user 'postgres',
      password '...password...'
    );
    -- Create foreign table
    create foreign table indiv14 (
    ...ddl....
    );
    And there is a compound (btree) index in indiv14, so that locally it uses an index scan:
    Copy code
    EXPLAIN VERBOSE select * from indiv14 where name='sdfsdf' limit 25;
    
    Limit  (cost=0.43..10.47 rows=8 width=148)
    
      ->  Index Scan using indiv14_name_zip_code_idx on public.indiv14  (cost=0.43..10.47 rows=8 width=148)
    
            Index Cond: ((indiv14.name)::text = 'sdfsdf'::text)
    
    Query Identifier: -2987151377721656964
    But when I use the foreign data wrapper, I get a scan:
    Copy code
    Limit  (cost=100.00..111.67 rows=1 width=596)
    
      ->  Foreign Scan on public.indiv14  (cost=100.00..111.67 rows=1 width=596)
    
            Remote SQL: SELECT cmte_id, amndt_ind, rpt_tp, transaction_pgi, image_num, transaction_tp, entity_tp, name, city, state, zip_code, employer, occupation, transaction_dt, transaction_amt, other_id, tran_id, file_num, memo_cd, memo_text, sub_id FROM public.indiv14 WHERE ((name = 'sdfsdf'))
    Help
  • Changing the user's email without their involvement
    o

    OberstKlinck

    03/20/2023, 4:53 PM
    Hi, I'd like to manually change the email address of one of my users in a supabase.com-hosted Supabase project. They signed up using the basic email auth provider. I'd like to change the address myself without having to involve the user. At least in the UI I can't seem to be able to edit the
    auth.users
    table. and the Users overview doesn't allow for an email change. How can I do it?
    g
    • 2
    • 2
  • How to pass custom header to realtime
    m

    Martin INDIE MAKERS

    03/20/2023, 7:43 PM
    i use this to pass custom headers to Supabase query.
    Copy code
    ts
    export const useSupabaseTest = (capgkey: string) => {
      const options: SupabaseClientOptions<'public'> = {
        global: {
          headers: {
            capgkey,
          },
        }
      }
      return createClient<Database>(supabaseUrl, supabaseAnonKey, options)
    }
    That allow me to check the capgkey in RLS with
    Copy code
    sql
    (current_setting('request.headers'::text, true))::json ->> 'capgkey'::text)
    That work like a charm. Sadly with realtime query the RLS prevent the event to be broadcast. i tried to follow what is said here: https://supabase.com/docs/guides/realtime/postgres-changes#custom-tokens and updated my code like that
    Copy code
    ts
    export const useSupabaseTest = (capgkey: string) => {
      const options: SupabaseClientOptions<'public'> = {
        global: {
          headers: {
            capgkey,
          },
        },
        realtime: {
          params: {
            capgkey,
          },
        },
      }
      return createClient<Database>(supabaseUrl, supabaseAnonKey, options)
    }
    I can see in my front capgkey is sended but the broadcast still not happen. Do someone know how to handle this case, or at least how to inspect logs on Supabase side to know whats happening ?
    g
    • 2
    • 34
  • Content-type not acceptable: application/json, text/plain
    t

    twotwice

    03/20/2023, 8:50 PM
    its really hard to figure out whats going on, please help. I've got this few lines of code, const { createClient } = require('@supabase/supabase-js') const supabaseAdmin = createClient(URL, KEY) supabaseAdmin.rpc( custom function, params) but it throws the error on title... i've already double checked all types, might it be because im not using an ES6 import? or because not using ts? all param are of the correc type, like a vector of strings a double and an integer.
    g
    d
    • 3
    • 4
  • Anyone know if we can use Prisma + Supabase + Supabase Auth (go true)? Any examples?
    d

    DYELbrah

    03/20/2023, 9:15 PM
    Just curious if anyone has any examples of using Prisma + Supabase + Supabase Auth?
    • 1
    • 1
  • access token being set in url
    b

    Benanna19

    03/20/2023, 10:30 PM
    I've been following the next13 server component walkthrough and I can't figure out why the access token is displaying in the url. I can provide code as needed but I've just walked through the whole process and the only difference is I am using the github provider and signing in with OAuth which is attaching the full access token to the url. It's probably some understanding I don't have with how OAuth works but would love to understand πŸ™
    j
    i
    +2
    • 5
    • 15
  • Can't reach database server at `localhost`:`5432`
    l

    Lar

    03/20/2023, 10:50 PM
    I run: $
    source .env && prisma migrate dev
    Environment variables loaded from .env Prisma schema loaded from prisma\schema.prisma Datasource "db": PostgreSQL database "xxx@db.xxx.supabase.co:5432/postgres", schemas "public" Error: P1001: Can't reach database server at `localhost`:`5432` Please make sure your database server is running at `localhost`:`5432`. [1]+ Done DATABASE_URL=postgresql://postgres:xxx@db.xxx.supabase.co:5432/postgres Larry@ASUS MINGW64 /c/__repos/_wip/pinz.ai (main) $ source .env && prisma migrate dev Environment variables loaded from .env Prisma schema loaded from prisma\schema.prisma Datasource "db": PostgreSQL database "xxx@db.xxx.supabase.co:5432/postgres", schemas "public" Error: P1001: Can't reach database server at `localhost`:`5432` Please make sure your database server is running at `localhost`:`5432`.
    NOTE
    I CAN connect to db using datagrip. I SEE db in SB Dashboard. My schema.prisma partial:
    Copy code
    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["multiSchema"]
    }
    
    datasource db {
      provider = "postgres"
      url      = env("DATABASE_URL")
      directUrl= env("DIRECT_URL")
      schemas  = ["public"]
    }
    I have experienced issues with Dashboard involving messages like:
    Problem access project statistics
    ,
    Project doesn't exist (top right toast)
    ,
    duplicate project names
    . Currently unable to proceed.
    • 1
    • 2
  • How to write a RLS policy WITH CHECK so that only a certain column can be updated?
    v

    Vik

    03/20/2023, 10:59 PM
    I want to create a policy to make sure only the
    approved
    column on my
    relationships
    table can be updated if it has not already been approved. This is what I have but I run into this error:
    Error adding policy: failed to create pg.policies: missing FROM-clause entry for table "new"
    g
    • 2
    • 4
  • JavaScript client library (v2.10.0) table .select() creates extraneous Timer when imported with Deno
    f

    fowl

    03/20/2023, 11:59 PM
    Hello! I made a thread in the Deno Discord about this same topic, but my gut tells me this is an issue with the Supabase client library and not Deno. I have a script that looks like the following:
    Copy code
    import "https://deno.land/x/dotenv@v3.2.2/load.ts"
    import { createClient } from 'https://esm.sh/@supabase/supabase-js@2.10.0'
    import { ensureDirSync } from "https://deno.land/std@0.178.0/fs/ensure_dir.ts"
    ...
    const supabaseUrl = Deno.env.get("SUPABASE_URL")
    const supabaseKey = Deno.env.get("SUPABASE_KEY")
    const supabase = createClient<Database>(supabaseUrl, supabaseKey)
    ...
    const doDownloads = async () => {
      // getting storage download paths
      console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr" }
      
      const { data, error } = await supabase
        .from('myTable')
        .select<'*', RowType>()
      
      console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr", "3": "timer" }
    
      // ensures dir exists with ensureDirSync then downloads with supabase.storage
    }
    ...
    doDownloads()
      .then(() => {
        console.log('Downloads complete!')
        console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr", "3": "timer" }
      })
      .catch((err) => {
        console.error(err)
        console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr", "3": "timer" }
      })
    
    console.log('Downloading...')
    console.log(Deno.resources()) // { "0": "stdin", "1": "stdout", "2": "stderr" }
    
    export {}
    Ran with
    deno run --allow-env --allow-net --allow-read --allow-write deno/doDownloads.ts
    So as shown in the comments in the code, the
    .select
    query from the
    supabase
    client creates some timer resource that is not cleaned up properly. This is an issue because the script will hang/will not exit after being ran, unless I add
    Deno.close(3)
    to the
    .then
    and
    .catch
    functions. This does not occur when I convert the script to Node.js, but I have no way of knowing if this is a Deno transpilation or Supabase client issue.
  • How to persist among db resets the storage-buckets
    b

    brt

    03/21/2023, 12:28 AM
    I'm using supabase CLI locally and I've created a public bucket on my project. The problem: when setting up the project the very first time, or when resetting the DB via
    supabase db reset
    , the buckets are gone. I'm wondering if there's a simple way to persist it from the command line, like with the public schema and its migrations files. If not: what best practice do you suggest? I was thinking about pg_dump it in binary and add the output on my project.
    g
    • 2
    • 8
1...173174175...230Latest