Questions tagged [supabase-js]

Supabase is an open source Firebase alternative

74 questions
1
vote
1 answer

Supabase JS: Best way to resubscribe to realtime database channel after it’s closed?

I’m using supabase-js with a React app, implementing its realtime functionality to get real-time updates from the database in the UI. Overall it’s working great. Sometimes, though, the realtime channels will close (they stop working and I get a…
Dave Feldman
  • 104
  • 1
  • 9
  • 28
1
vote
1 answer

Supabase - How can I skip the email confirmation stage of signing up, using auth-helpers for nextjs and the 'pages' directory?

Originally, I was performing client-side authentication in my NextJS app using the supabase-js library. However I'm switching over to using the auth-helpers-nextjs library for authentication so that I can access the User server-side (for stripe…
Beck
  • 11
  • 2
1
vote
1 answer

Nextjs 13 Supbase auth redirect post social login not working properly

I am having some trouble getting Supabase auth working properly in NextJS 13. I would like some pages to be protected and if the user navigates to those pages, they should first be redirected to the login page where they will need to login and then…
adeelmahmood
  • 2,371
  • 8
  • 36
  • 59
1
vote
1 answer

Supabase and Cloudflare Workers

How do i protect a Cloudflare Worker route to authorize only if the user is authenticated on Supabase? I'm using Cloudflare Pages Function to create a worker inside the Cloudflare Pages:…
1
vote
1 answer

Supabase won't take UPDATE query

I'm currently using supabase to make quick MVP for college work. I create feedback feature, so I have to update some columns in row. There is my JS query: const { error: updateError } = await supabase.from('route').update({ total_score: 5…
1
vote
2 answers

How to modify a Supabase table from the dashboard UI or the Supabase SQL editor?

Whenever I try to modify an existing table in the Supabase dashboard, I get this error "Failed to pg.columns: must be owner of table ". This seems to be like a permission issue but I'm not sure what has to be done to fix this. I have…
Prateik
  • 33
  • 5
1
vote
0 answers

Supabase SELECT with function call

From Javascript, I want to call a function in my supabase select statement (funcition name is id_encode in this example): const { data, error } = await supabase .from('table') .select("id, id_encode(id, 'salt', 8)") equivalent in…
Alan
  • 33
  • 3
1
vote
1 answer

Supabase query go get parent record with at least one child record?

I got two tables, customer (parent) and order (child) with a foreign key relation. Is there a query using the javascript SDK to get all parent records that have at least one child record? Using prisma, the query would look something like this: const…
erikvm
  • 858
  • 10
  • 30
1
vote
1 answer

Could not find the function in the schema cache ( RPC supabase )

Hi I have created a postgres function using the supabase ui with 4 parameters. see this screenshot function definition is begin insert into public.rooms (created_by_id, room_manager_id, room_name,…
1
vote
1 answer

supabase - How to prevent to not logged users to see vue app pages

I'm starting use supabase as an alternative to firebase. I'm implementing a siple authentication system for my vue webapp, I have a doubt about redirection. I've used the magic link solution to let the user login…
newbiedev
  • 2,607
  • 3
  • 17
  • 65
1
vote
2 answers

Return is executed before getting session in react using Supabase

I want to somehow get my return value after getting session. App.jsx file import { useEffect, useState } from 'react' import './App.css' import {Navigate} from 'react-router-dom' import { supabase } from './helpers/supabaseClient' function App() { …
SOHAM
  • 395
  • 1
  • 2
  • 8
0
votes
0 answers

Supabase-js: querying foreign table returns null

I have a table Requests with 2 foreign keys referencing auth.users and Categories Requests ------------------------------------------------------------------------------ | user_id (= auth.users.id) | title | description | category_id (=…
lumikso
  • 3
  • 3
0
votes
1 answer

supabase.auth.session is not a function in React App

import React, { useState, useEffect } from 'react'; import { createClient } from '@supabase/supabase-js'; const supabase = createClient('httpsfwefwfwfwf', 'wfw'); function App() { const [user, setUser] = useState(null); useEffect(() => { …
0
votes
1 answer

Supabase automatically rearranging table rows

I have a supabase table with a column of boolean type, whenever I change the value to TRUE or FALSE, the rows get rearranged automatically putting rows with set to TRUE at the top. I want rows to be in the same order as they were.
0
votes
1 answer

How can security can be ensured in this case by Supabase?

When a user in my application claps virtually in the theatre, it will send a request for increasing a count by 1 in Supabase. Currently, I am using signInWithPassword for authentication and the update RLS policy is enabled for authenticated users…