https://supabase.com/ logo
Join Discord
Powered by
# help
  • i

    ivanq3w

    08/20/2021, 7:40 PM
    Custom roles in JWT and auth.users
  • h

    HEAVYPOLY

    08/20/2021, 8:35 PM
    @User ok, thanks, will look at row level policies
  • g

    Gustavogsb

    08/20/2021, 8:49 PM
    Thanks
  • t

    ThisIsJustin

    08/20/2021, 10:13 PM
    Is it possible to have a where clause on a field from a joined table?
    Copy code
    select email 
    from public.space_users su 
    join users u on su.user_id = u.id
    where u.unsubscribed is null
    How can I do that last line with the supabase client?
  • m

    Miguel

    08/20/2021, 11:04 PM
    Hi everyone, how are you testing your application?
  • m

    Miguel

    08/20/2021, 11:05 PM
    For me testing is a big part of app development! Could you share any tips or tutorials?
  • b

    benwis

    08/21/2021, 1:28 AM
    I've got a complicated question ,the details are [here](https://old.reddit.com/r/PostgreSQL/comments/p8fgfe/recommendations_for_postgres_dbaas_options_with/). Essentially I'm setting up a multi-tenant solution using postgres RLS and I need to be able to set a custom postgres runtime parameter. I believe it's very similiar to what supabase uses for auth.uid() but I want to create and set app.current_tenant to be the nil tenant UUID so RLS will return nothing by default, and then my app will overwrite it on a per session base. Does anyone know if supabase will let you do that, either by editing postgresql.conf or running ALTER SYSTEM or maybe some other way?
  • m

    MrWolf

    08/21/2021, 2:19 AM
    Sooo I'm getting an error with the following creation script and not sure how to fix it: https://paste.in/i8rjcq
  • m

    MrWolf

    08/21/2021, 2:19 AM
    Copy code
    foreign key constraint "CoreProjects_fk0" cannot be implemented
  • m

    MrWolf

    08/21/2021, 2:19 AM
    Any ideas?
  • g

    Gustavogsb

    08/21/2021, 3:59 AM
    Does anyone have any example of functional password recovery in nextjs? I'm not able to capture the token in the link fragment that supabase sends me in the email.
  • y

    yurix

    08/21/2021, 7:06 AM
    Provider's social login Google. I have this login enabled -> https://xrcvldvpazufasqpqolt.supabase.co/auth/v1/authorize?provider=google The problem is that access is requested to go to * xrcvldvpazufasqpqolt.supabase.co * and this url is horrible, it seems that it is allowing access to some virus. XD Is there a way to mask it with the real name of my website?
  • d

    Di

    08/21/2021, 7:37 AM
    It's because your types aren't the same. public.CoreStates.id has type SERIAL, public.CoreProjects.State has type UUID
  • d

    Di

    08/21/2021, 7:41 AM
    Your code is valid! I'm not sure if you're able to do that with the supabase client, but you could write a view (https://supabase.io/blog/2020/11/18/postgresql-views) using your code, and just do a select from that view using the Supabase client
  • c

    CAMOU

    08/21/2021, 11:43 AM
    hey im trying to make a sign-up using supabase but for some reason im not getting any verification mail its just saying "waiting for verification" in the dashboard when I create a new user. can anyone help?
    Copy code
    js
    import supabase from '$lib/db'
    
    export async function post(request) {
        let email = request.body.get('email')
        let password = request.body.get('password')
        let c_password = request.body.get('c_password')
    
        if (password !== c_password) {
            return {
                status: 401,
                body: 'Passwords are not matching'
            }
        }
    
        const { session, error } = await supabase.auth.signUp({email, password})
    
        if (error) {
            return {
                status: error.status,
                body: error.message
            }
        }
    
        return {
            status: 200,
            body: 'success',
            headers: {
                'set-cookie': `session=${session.user.id}; Path=/; HttpOnly; Secure; SameSite=Strict; Expires=${new Date(session.expires_at * 1000).toUTCString()};`
            }
        }
    }
    s
    • 2
    • 12
  • s

    silentworks

    08/21/2021, 12:30 PM
    Supabase registration with Sveltekit not working
  • f

    fengkx

    08/21/2021, 1:46 PM
    Hi guys Can I have multi domain as Site URL and Additional Redirect URLs. I have deployed my app on vercel and it can has more than one domain
  • s

    silentworks

    08/21/2021, 1:48 PM
    Answered here https://github.com/supabase/supabase/discussions/2760#discussioncomment-1144158
  • f

    fengkx

    08/21/2021, 1:49 PM
    Thanks
  • f

    fengkx

    08/21/2021, 1:50 PM
    How about the configuration on dashboard. How to write Site URL
  • s

    silentworks

    08/21/2021, 1:51 PM
    Write a comma separated list of urls
  • f

    fengkx

    08/21/2021, 1:53 PM
    Can I set redirectTo
    window.location.href
    ? any security issue?
  • p

    Peanut

    08/21/2021, 2:28 PM
    Is the "role" field in a JWT reserved? When I provided something different in my custom JWT postgrest gave me no permission errors but when I changed it to "custom_role" it worked
  • p

    Peanut

    08/21/2021, 2:35 PM
    Another thing - why am I getting a 401 error when trying to sign out?
    {"code":401,"msg":"Invalid user"}
    I am using the js
    .signOut()
    method and I tried passing my custom JWT and without it.
  • p

    Peanut

    08/21/2021, 3:17 PM
    Also when I have a JWT and it includes something like "isAdmin: true" and I remove that flag from the user in a table is there a way to invalidate their JWT or will they have admin access until I change my backend to lookup their user from the table first OR their JWT expires?
  • m

    MrWolf

    08/21/2021, 5:34 PM
    Thank you, I appreciate it... that's what I get for writing it after a couple moscow mules
  • u

    user

    08/21/2021, 7:42 PM
    Hi guys, I'm trying to add UNIQUE constraint to existing table with no success, I've always errors about index or relation. This is the sintax: ALTER TABLE tags ADD,CONSTRAINT unique_tag UNIQUE (tag); tags is the table and tag is the column
  • m

    MrWolf

    08/21/2021, 10:54 PM
    without seeing the rest of the table makeup it would be pretty hard to guess the reason behind the issue, but it sounds like this tag column already has a constraint on it interfering with your command
  • m

    MrWolf

    08/21/2021, 10:55 PM
    I recommend using pgAdmin to inspect the table and it's constraints. You can also use it to modify the table directly
  • s

    shubhamverma

    08/22/2021, 2:39 AM
    Hey, How can I insert rows and create columns if not present? I tried
    Copy code
    js
    supabse.from("table_name").insert([...])
    But didn't work?What am I doing wrong here?
1...575859...316Latest