https://supabase.com/ logo
Join Discord
Powered by
# help-and-questions
  • Handling new users for multiple subdomains in same Supabase project.
    e

    EKI

    05/23/2023, 4:59 PM
    I have 2 subdomain, one for staffs and another for students but the issue here is that some students are also staff so if they signup using student(subdomain) with same email or phone they can't signup to teachers(subdomain) with that email and phone. I want them to create account on teachers(subdomain) like signup even though they already signed up on students(subdomain). Is there any way?
    g
    • 2
    • 4
  • Is there a way to pass deno v8 flags to functions under the edge-runtime?
    d

    Dan Rumney

    05/23/2023, 5:03 PM
    I'd like to be able to generate coverage information while running my edge functions. This is possible by setting the
    --trace-block-coverage
    v8 flag to
    deno run
    . Is there an equivalent process for doing this with the
    edge-runtime
    command?
  • Can we remove Auth and direct redirect to login?
    v

    vikay

    05/23/2023, 5:24 PM
    hello so basically i don't want that auth page layout so can we remove it? and automatic redirect to auth page of platform?
    g
    • 2
    • 22
  • Issue setting up the local env for contribution
    a

    ArjunXD

    05/23/2023, 5:49 PM
    can anyone help me with this while setting up the local env for open source contribution I am getting thi error on running "npm install"

    https://cdn.discordapp.com/attachments/1110625540886495313/1110625541020729415/image.png▾

  • int8[] converted to strings?
    y

    yayza_

    05/23/2023, 6:00 PM
    I'm trying to use a column that I set as int8 and checked "Define as array". When I insert data as a test like the example below, they get converted into strings. Is this normal? 🤔 https://cdn.discordapp.com/attachments/1110628252793446511/1110628253145776150/msedge_xOLjLRRK26.mp4
    g
    • 2
    • 26
  • Auth URL Argument Is Missing - unable to create users via dashboard or signup function
    c

    Chez

    05/23/2023, 6:26 PM
    Hello guys, I'm working on integrating authentication using Supabase Javascript client for a full stack application. I have been receiving errors such as "url argument is missing for auth". I have attempted to change the Site Url multiple times to see if the issue was a trailing slash or whichever. Attached are some images with some background regarding the issue. For context, this is a brand new project with no tables, function, webhooks etc. I'm simply trying to connect a signup form to Supabase Auth database but am receiving url argument is missing error. Any help would be appreciated! Let me know if there is additional information that is required.

    https://cdn.discordapp.com/attachments/1110634802073317396/1110634802257858711/auth_attempt.png▾

    https://cdn.discordapp.com/attachments/1110634802073317396/1110634802572427294/auth_functions.png▾

    https://cdn.discordapp.com/attachments/1110634802073317396/1110634802895400960/auth_triggers.png▾

    https://cdn.discordapp.com/attachments/1110634802073317396/1110634803277070516/auth_url.png▾

    https://cdn.discordapp.com/attachments/1110634802073317396/1110634803662958612/auth_users.png▾

    g
    • 2
    • 21
  • Why auth.getSesstion() not working for get data?
    v

    vikay

    05/23/2023, 6:34 PM
    Why this discord auth functions not working?
    Copy code
    js
    import { useRouter } from 'next/router';
    import { useState, useEffect } from 'react';
    import supabase from '@/components/supabase';
    
    export default function Auth2() {
      const router = useRouter();
      const [session, setSession] = useState('');
    
        useEffect(async () => {
            const data = await supabase.auth.getSession();
            if (!data) return;
            setSession('GetData');
        }, []);
    
      supabase.auth.onAuthStateChange(async (event) => {
        if (event === "SIGNED_IN") {
          router.push('/dashboard');
        }
        if (event === 'SIGNED_OUT') {
            router.push("/");
        }
      });
    
        async function signInWithDiscord() {
            const { data, error } = await supabase.auth.signInWithOAuth({
                provider: 'discord',
                options: {
                    scopes: 'identify guilds'
               }
            });
        }
        async function signout() {
            const { error } = await supabase.auth.signOut();
        }
        
        if (session === "GetData") {
            signout();
        } else {
            signInWithDiscord();
        }
    }
  • Question about my Subscription
    d

    Dilly

    05/23/2023, 6:45 PM
    I created a project on the Pro tier. I had 2 free projects and 1 pro project. I just deleted the pro project with the intention of recreating it, but now its prompting me to pay again, even though I already paid. I didn't realize this would happen. Am I going to be charged twice now within a single week period because I did this?
    g
    • 2
    • 1
  • Supabase storage and Cloudinary
    r

    Revaycolizer

    05/23/2023, 7:24 PM
    Hi guys using cloudinary but seems transformation is not working``` const fetchPosts=useCallback(async()=>{ const { data:files } = await supabase .from('category') .select() if(files && files.length>0){ const promises = files.map(async(file)=>{ const { data: { publicUrl } } = supabase.storage .from('files') .getPublicUrl(file.vname); const myImage = new CloudinaryImage(publicUrl, {cloudName: 'cloudname'}) .resize(fill().width(100).height(200)); return {id:file.id, myImage:myImage}; }); const posts = await Promise.all(promises); setDownload(posts); console.log(posts) } ```
    o
    g
    n
    • 4
    • 11
  • Login with google in ios with ionic
    m

    matteo6b

    05/23/2023, 10:41 PM
    hi guys, i can´t work login with google from supabase in ios ionic only works in web , anyone help me?
  • Creating users with roles and role based access control
    d

    DDupasquier

    05/23/2023, 11:48 PM
    I'm working on an application where users need to log in with specific roles: Org, Admins, Leads, and Employees. Upon creating a new row in the auth.user table, I receive the following JSON object:
    Copy code
    json
    {
        "user": {
            "id": "21cd995a-84ae-42f3-a9e8-3cd48074ba84",
            "aud": "authenticated",
            "role": "authenticated",
            "email": "ihopethisworks@gmail.com",
            "phone": "",
            "confirmation_sent_at": "2023-05-23T23:38:06.314959404Z",
            "app_metadata": {
                "provider": "email",
                "providers": [
                    "email"
                ]
            },
            "user_metadata": {},
            "identities": [
                {
                    "id": "21cd995a-84ae-42f3-a9e8-3cd48074ba84",
                    "user_id": "21cd995a-84ae-42f3-a9e8-3cd48074ba84",
                    "identity_data": {
                        "email": "ihopethisworks@gmail.com",
                        "sub": "21cd995a-84ae-42f3-a9e8-3cd48074ba84"
                    },
                    "provider": "email",
                    "last_sign_in_at": "2023-05-23T23:38:06.312979098Z",
                    "created_at": "2023-05-23T23:38:06.313013Z",
                    "updated_at": "2023-05-23T23:38:06.313013Z"
                }
            ],
            "created_at": "2023-05-23T23:38:06.310532Z",
            "updated_at": "2023-05-23T23:38:06.737187Z"
        },
        "session": null
    }
    I'm wondering if there's a way to access the role key in this JSON object and change it to a specific role such as Admin or Lead. Additionally, I would appreciate recommendations on the best approach to assign roles in this scenario. Should I have each user create their own profile and assign their roles, or is it better to have the organization or designated administrators create and assign roles to users? Since this application is intended as an internal tool, it seems logical for the organization to manage account creation and role assignments. What would be the recommended approach for implementing role-based access control? I'm having trouble finding information on how to achieve this and where to start. Any guidance or clarification would be greatly appreciated!
    g
    m
    • 3
    • 6
  • TypeError:supabase.from is not a function
    k

    King

    05/23/2023, 11:49 PM
    I successfully created a client, but this doesn't work.

    https://cdn.discordapp.com/attachments/1110716145054515210/1110716145171959828/neww.png▾

    g
    • 2
    • 2
  • Bubble to sbaseupa
    n

    navarrobedoya

    05/24/2023, 12:07 AM
    Have anyone connected Bubble database with Supabase? #885237287280070708 #bubble. Are there any #867349237799714856 videos tha
  • auth with new app directory
    a

    alana

    05/24/2023, 12:39 AM
    hi there, i'm struggling to access user data with the new app dir / auth helpers (following this guide: https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-components) is there an equivalent of the
    useUser()
    function? or any examples you can point me to for how to access user data when signed in? simple use case is just showing an account page with profile info when a user signs in. thank you!
  • Matching timestampz column by date instead of exact
    m

    mansedan

    05/24/2023, 1:09 AM
    Hey there, Is there a way with the supabase-js libray to match a timestampz column just by the DATE, instead of the exact timestamp?
    g
    • 2
    • 3
  • Update password from password recovery email
    h

    helmik

    05/24/2023, 1:11 AM
    I'm trying to change users passowrd from password recovery email The email template and redirect to my web site is working well, actually I can get .Toke, .TokenHask and .Email variables in my react app Now, I want to update a new password with this information but I cannot do it. I have seen that I can use supabase.auth.updateUser( accessToken, { password: '123456' }) but this does not work. somebody know how to update the password in a secure way? Thanks in advance 🙂
    g
    s
    • 3
    • 6
  • Unable to delete row with (auth.uid() = user_id)
    b

    bdz

    05/24/2023, 2:30 AM
    I am unable to delete a row with (auth.uid() = user_id) policy, and a select policy in place. Update and Insert works I feel like I am over looking something but not exactly sure what it is.

    https://cdn.discordapp.com/attachments/1110756575238426724/1110756575506866186/Screenshot_2023-05-23_at_10.27.56_PM.png▾

    https://cdn.discordapp.com/attachments/1110756575238426724/1110756575855005756/Screenshot_2023-05-23_at_10.29.30_PM.png▾

    https://cdn.discordapp.com/attachments/1110756575238426724/1110756576186339379/Screenshot_2023-05-23_at_10.29.38_PM.png▾

    g
    • 2
    • 12
  • My supabase is missing the realtime schema.
    o

    ostoto

    05/24/2023, 2:33 AM
    What happened here? How can I setup realtime?
    g
    • 2
    • 17
  • What does `primaryKey` in `stream` actually do??
    c

    caseycrogers

    05/24/2023, 2:53 AM
    The docs give no explanation as to what does and doesn't trigger an update. Most importantly, it doesn't explain what
    primaryKey
    does. For example, I have a table with the syntax
    id | created_at | user_id | ...
    where
    id
    is the primary key. How do I write a query that returns events for the most recent row for a given
    user_id
    ? The following is what I wrote but I'm not getting any updates after the first event and my best guess is it's because of
    primaryKey
    but
    primaryKey
    is almost entirely undocumented so I'm not sure...
    Copy code
    dart
    return supabase.from('myTable')
            .stream(primaryKey: [idCol])
            .eq(anonIdCol, anonId)
            .order(createdAtCol, ascending: false)
            .limit(1);
    w
    g
    t
    • 4
    • 32
  • auth helper setup nextjs 13.4
    z

    zach

    05/24/2023, 3:01 AM
    I created a supabase-provider.jsx file in the root of my app directory (attached). I also added this provider to my root layout.js (attached). I am following the instruction from this article: https://supabase.com/docs/guides/auth/auth-helpers/nextjs-server-components But NextJS keeps telling me I need the 'use client' directive in supabase-provider.jsx to declare "useContext" hook. Why would it throw this error when its pretty clear that I have added and saved the file with the 'use client' directive to the top of the file.

    https://cdn.discordapp.com/attachments/1110764363406659594/1110764363834466335/Screenshot_2023-05-23_at_10.59.13_PM.png▾

    https://cdn.discordapp.com/attachments/1110764363406659594/1110764364182601768/Screenshot_2023-05-23_at_10.58.51_PM.png▾

    • 1
    • 1
  • while using supabase auth after login it automatic redirects to home page
    v

    vikay

    05/24/2023, 4:27 AM
    Hello, basically i am trying to make discord auth login but after login page automatic redirect to home page why?
    d
    • 2
    • 2
  • Flutterflow connect to Selfhosted Supabase issue
    d

    DubC

    05/24/2023, 4:28 AM
    When I add the correct domain and anon key into the flutterflow interface, and click 'Get Schema' it does nothing. I tried the rest and kong endpoints also. Any tips to overcome this?

    https://cdn.discordapp.com/attachments/1110786369783083059/1110786369892126840/image.png▾

    • 1
    • 3
  • Is there a way to limit nested queries?
    c

    coop

    05/24/2023, 5:32 AM
    await supabase .from('jobs') .select( 'full_title, branch_id, state, created_at, location, updated_at, slug, wage_lower_bound, wage_upper_bound, candidates (*)' ) .eq('org_id', userData.org_id) .neq('candidates.disqualified', true) .in('state', ['published', 'closed']) Is there anyway to limit the number of candidates rows in this nested query (not just the jobs rows)?
    g
    • 2
    • 2
  • Why session data in not rendering in auth?
    v

    vikay

    05/24/2023, 6:53 AM
    hello there, basically i am making a button for redirect login and logout but getting a issues about session data is not rendering for show text here my navbar codes. in my codes the login ButtonName show still after login why?

    https://cdn.discordapp.com/attachments/1110822979811688559/1110822979950092329/Screenshot_2023-05-24_122132.png▾

  • How to tell if 'Create a new user' failed because of existing email?
    d

    drilkmops

    05/24/2023, 7:18 AM
    I see in the dosc that it gets obfuscated on client side, but is there any possible way i can check this?
    Copy code
    If Confirm email is enabled in your project, an obfuscated/fake user object is returned.
    I'm essentially just trying to do this flow: - let users fill out form without creating account - on fill out of form, prompt to sign up - on sign up success i save the form data to my backend Just trying to make it as simple to onboard folks as I can! https://supabase.com/docs/reference/javascript/auth-signup
    • 1
    • 1
  • Login in as supabase_admin in Supabase Cloud
    i

    iqn

    05/24/2023, 7:27 AM
    I have been trying to migrate some db changes from the public schema from another Supabase project, but since postgres version is different, I cannot use diff/pg_diff right off the bat, the scripts from the dump that alters the privileges for the superbase_admin fails since I am logged in as the user 'postgres'. Is there a way to work around this?
    v
    • 2
    • 1
  • Local dev: `supabase db diff` not picking up privilege changes
    c

    Crembo

    05/24/2023, 8:08 AM
    Hi folks, I'm trying to do all my messing around in local dev before finalizing a migration script and pushing it to prod, and so far everything looks good except the command doesn't seem to have picked up on any of the privilege changes I've made. (eg making a column read only via:
    REVOKE INSERT, UPDATE ON table FOR authenticated
    GRANT INSERT (col1, col2, ... all the columns except created_at) ON table FOR authenticated
    ) Am I missing a flag?
    s
    • 2
    • 1
  • Getting Invalid Refresh Token and logout
    h

    huksley

    05/24/2023, 8:29 AM
    I am getting the REST error "Invalid Refresh Token: Already used" and after that I am logged out in my app. I think I know why it happens - access token used on both client side and server side, and once it is used for refresh at either, it fails to work at another side. The question is, how it is supposed to work? Both server side and client side need to have user authenticated, but there is no guaranteed communication between them, even if I ping every 10 seconds (which is wrong IMO) because browser can be closed, tab can be unloaded, etc. Related settings: Project Settings => Auth => JWT expiry limit & Reuse interval & Enable automatic reuse detection Relevant posts here: https://discord.com/channels/839993398554656828/1011635657006923828 and https://github.com/supabase/gotrue-js/issues/620
    g
    • 2
    • 4
  • Join on a table twice using the supabase.from(table).select(...
    m

    mattposgate

    05/24/2023, 8:34 AM
    Hi all, I'm trying to join twice on the same table. Example is an accounts table with both a billing address id and a delivery address id, both pointing to the address table. I'm getting the following message: table name "account_address_1" specified more than once. What can i do?
    s
    • 2
    • 3
  • Checking if the login with discord was authorized successfully
    s

    ShadowOP

    05/24/2023, 9:05 AM
    how do I check if the login with discord was authorized successfully? I tried did the code below, but as soon as I click the login button the afterSignIn callback function gets called. I want to check if the user authorization was successful then only I want to execute the afterSignIn
    Copy code
    js
    export async function signInWithDiscord(afterSignIn) {
      const { data, error } = await supabase.auth.signInWithOAuth({ provider: "discord" })
    
      if (error) {
        console.error("Authorization failed:", error.message)
        return
      }
    
      if (data) {
        if (afterSignIn) {
          afterSignIn()
        }
      }
    }
    g
    • 2
    • 8
1...224225226...230Latest