garyaustin
03/03/2022, 8:08 PMjoa
03/03/2022, 9:01 PMuid
, but how do I incorporate that uid in the POST/GET requests? Is it some header?garyaustin
03/03/2022, 9:19 PMrahat
03/03/2022, 11:41 PMirrationaljared
03/04/2022, 2:03 AMsupabaseClient.auth.user()
from the client I get a user back but when that user makes a request from the client to the server and I call supabaseClient.auth.api.getUserByCookie(req, res)
on the server I get an error saying "Invalid Refresh Token". How is supposed to be handled? Am I missing documentation about this?bluetoothfx
03/04/2022, 3:05 AMScott P
03/04/2022, 3:43 AMAmusedGrape
03/04/2022, 3:56 AMbluetoothfx
03/04/2022, 4:01 AMgaryaustin
03/04/2022, 4:06 AMdeliana
03/04/2022, 5:42 AMAxel
03/04/2022, 9:07 AMrohanrajpal
03/04/2022, 9:28 AMbookings
Now I need to fetch its schema, how do I do it via the SQL editor?
Running describe bookings;
gives an error syntax error at or near "describe"
Also where do I get the database name? Is it the project name? if yes then describe crud_backend.bookings;
is throwing the same error as well
Would appreciate any help πsilentworks
03/04/2022, 9:54 AMjoshcawthorne
03/04/2022, 11:31 AMbluetoothfx
03/04/2022, 1:58 PMextra_hosts:
- "host.docker.internal:host-gateway"
garyaustin
03/04/2022, 2:00 PMCiriak
03/04/2022, 2:10 PMtextSearch()
conditionally ?
In this example i don't want to invoke textSearch() if searchQuery is empty
I tried passing "*" or an empty string but no luck and i didn't find anything on the documentation about "empty textSearch" π€ak4zh
03/04/2022, 4:45 PMbradgarropy
03/04/2022, 5:23 PM@supabase/supabase-auth-helpers
package to enable authentication in Next.js on the client and the server.
https://github.com/supabase-community/supabase-auth-helpers/tree/main/src/nextjs
After logging in, I redirect over to /todos
.
const handleSignin: FormEventHandler<HTMLFormElement> = async event => {
event.preventDefault()
await supabase.auth.signIn({
email,
password,
})
router.push("/todos")
}
But the redirect doesn't work the first time. Or it's bouncing back to /login
. After logging in a second time, then it work. I presume because the session cookie has not yet been set.
const getServerSideProps = withAuthRequired({
redirectTo: "/login",
getServerSideProps: async ctx => {
const todos = await readAllTodos(ctx)
return {
props: {
initialTodos: todos,
},
}
},
})
Here's the live site and the code.
https://next-todo-one.vercel.app
https://github.com/bradgarropy/next-todothorwebdev
03/04/2022, 5:39 PMxavier
03/04/2022, 8:22 PMramoncarden
03/05/2022, 4:15 AMjs
const ChatRoom = ({ session }) => {
const { roomId } = useParams();
const getAllMessages = async () => {
console.log(roomId);
let { data, error } = await supabase
.from('messages')
.select('*')
.eq('channel_id', roomId);
if (error) {
console.log(error);
}
if (data) {
setMessages(data);
}
};
const messageSubscription = supabase
.from('messages')
.on('*', (message) => {
console.log('Change received!', message);
})
.subscribe();
useEffect(() => {
getAllMessages();
}, [messageSubscription]);
garyaustin
03/05/2022, 4:53 AMramoncarden
03/05/2022, 4:59 AMramoncarden
03/05/2022, 5:02 AMrisingryzen
03/05/2022, 6:11 AMusers
and items
. I am trying to enable RLS on items
so that a user can only update their own items
. My RLS rule is:
create policy "Can only update their own items." on items for update using (
auth.uid() = owner
)
I keep seeing new row violates row-level security policy for table "items"
however in the NextJS app. I am passing in the owner field in the request.
{name: "test1", owner: "b1975ef4-f65c-4db5-8f4b-e63f128cf8c6"}
name: "test1"
owner: "b1975ef4-f65c-4db5-8f4b-e63f128cf8c6"
fengkx
03/05/2022, 10:10 AMauth.users
table to public.pusers
in supabase. I have a enum column call user_role
with enum type in pusers
table. I try to update my docker and I found Database error saving new user" component=api error="failed to close prepared statement: ERROR: current transaction is aborted, commands ignored until end of transaction block (SQLSTATE 25P02): ERROR: type \"user_role\" does not exist
this error in when I use the sdk to sign up a user. But I can successfully insert a row to auth.users
and sync to pusers
by directly run SQL in psqlfengkx
03/05/2022, 10:11 AMramprit
03/05/2022, 10:54 AM