jameswong
12/28/2022, 8:14 AMhttps://user-images.githubusercontent.com/87692325/209778636-884a830a-a1df-49c9-a92a-4968ea77fba9.png▾
https://example.com {
reverse_proxy /rest/v1/* localhost:8000
reverse_proxy /auth/v1/* localhost:8000
reverse_proxy /realtime/v1/* localhost:8000
reverse_proxy /storage/v1/* localhost:8000
reverse_proxy /pg/v1/* localhost:8000
reverse_proxy * localhost:3000
basicauth / {
name $yourhashedpassword
}
header {
Content-Security-Policy "upgrade-insecure-requests"
}
log {
output file /var/log/access.log {
roll_size 1gb
roll_keep 5
roll_keep_for 720h
}
}
}
docker-compose.yml
realtime:
container_name: supabase-realtime
image: supabase/realtime:v0.25.1
depends_on:
db: # Disable this if you are using an external Postgres database
condition: service_healthy
restart: unless-stopped
environment:
DB_HOST: ${POSTGRES_HOST}
DB_PORT: ${POSTGRES_PORT}
DB_NAME: ${POSTGRES_DB}
DB_USER: supabase_admin
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_SSL: "false"
PORT: 4000
JWT_SECRET: ${JWT_SECRET}
REPLICATION_MODE: RLS
REPLICATION_POLL_INTERVAL: 100
SECURE_CHANNELS: "true"
SLOT_NAME: supabase_realtime_rls
TEMPORARY_SLOT: "true"
command: >
bash -c "./prod/rel/realtime/bin/realtime eval Realtime.Release.migrate
&& ./prod/rel/realtime/bin/realtime start"
Any help would be appreciated ~psteinroe
12/28/2022, 8:51 AMCaptain
12/28/2022, 9:24 AMmadjar
12/28/2022, 9:47 AMJesuscc9
12/28/2022, 9:52 AMjavascript
user: {
inventory: [{...etc}]
}
is there any way, to instead of receiving an array, just receive an object? because you know that user can only have an inventorySaeed
12/28/2022, 10:11 AMError: Remote database Postgres version 15 is incompatible with db.major_version 14. If you are setting up a fresh Supabase CLI project, try changing db.major_version in supabase/config.toml to 15.
I also tried to change that to 15. but I get this:
Error: Failed reading config: Invalid db.major_version: 15.
Try rerunning the command with --debug to troubleshoot the error.
Maxoouuu
12/28/2022, 10:36 AMdavismarques
12/28/2022, 11:26 AMwykonos
12/28/2022, 11:30 AMglatocha
12/28/2022, 11:41 AM0xAsimetriq
12/28/2022, 12:15 PMmoroshko
12/28/2022, 12:41 PMawait browserSupabaseClient.auth.resetPasswordForEmail(email, { redirectTo: "/choose-password" })
.
When the user clicks the link in the email, they are redirected to /
and after that a redirect to /choose-password
happens.
The reset link contains &redirect_to=mysite.com
, not &redirect_to=mysite.com/choose-password
as I expected.
Why the redirect happens only on the client side? Is it possible to redirect on the server?silentworks
12/28/2022, 12:52 PMCriminelis
12/28/2022, 1:23 PMINF component=api method=POST msg=request started path=/invite referer= remote_addr=xxx timestamp=2022-12-28T13:07:31Z
ERR auth_event={"action":"user_invited","actor_id":"00000000-0000-0000-0000-000000000000","actor_username":"service_role","log_type":"team","traits":{"user_email":"test@example.com","user_id":"769ea869-bf4c-4212-a400-8de688bd472c"}} component=api error=Error sending invite email: dial tcp 185.107.232.248:587: i/o timeout method=POST msg=500: Error inviting user path=/invite referer= remote_addr=xxx timestamp=2022-12-28T13:07:31Z
INF auth_event={"action":"user_invited","actor_id":"00000000-0000-0000-0000-000000000000","actor_username":"service_role","log_type":"team","traits":{"user_email":"test@example.com","user_id":"769ea869-bf4c-4212-a400-8de688bd472c"}} component=api duration=10098168232 method=POST msg=request completed path=/invite referer= remote_addr=xxx status=500 timestamp=2022-12-28T13:07:31Z
MaheshtheDev
12/28/2022, 1:30 PMsunech
12/28/2022, 2:48 PMdp
12/28/2022, 3:53 PMget_random_uuid()
function but I'm getting this error:
Execution Error: error returned from database: function get_random_uuid() does not exist
Do I need to change some settings or otherwise modify my database to enable this functionality? The Supabase UI shows I already have UUID-OSSP
enabled.Taqi
12/28/2022, 4:05 PMVik
12/28/2022, 5:40 PMSue
12/28/2022, 6:47 PMNoah
12/28/2022, 6:59 PMSmardrengr
12/28/2022, 8:08 PMhensou
12/28/2022, 8:11 PMgetSession
to get the session from an url invite with the following code:
typescript
const getSessionFromUrl = async () => {
const { data, error } = await supabase.auth.getSession()
console.debug('getSessionfromUrl-data', data)
if (error) {
console.error('error', error)
toast({ status: 'error', title: 'Error', description: 'description' })
return
}
const { session: newSession } = data
setSession(newSession)
console.debug('session', newSession)} //<-- this is always null
It does not throw any error, but the session is always null for some reason that I can't figure out. And it was working before I've updated supabase with supabase stop && supabase start
Do you have any clue to what I'm missing here?zeyad
12/28/2022, 9:02 PMjson
{
"code": "23503",
"details": "Key is not present in table \"users\".",
"hint": null,
"message": "insert or update on table \"objects\" violates foreign key constraint \"objects_owner_fkey\""
}
Crownie
12/28/2022, 9:32 PMsupabase-auth-token
this seems to be the key on how supabase get the session/user on the nextjs api server (please confirm if anyone knows)
js
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
const supabase = createServerSupabaseClient<DatabaseTypes>({ req, res });
}
------------------------
When I do client side axios calls
The supabase-auth-token
is already in there
When I do server side axios calls (getServerSideProps)
The supabase-auth-token
is not in there,
note: (axios {withCredentials:true}
) doesn't work
----------------------------
is there a way to get the supabase-auth-token
on serverSideProps?joshtwist
12/29/2022, 1:07 AM{user?.id}
- the page does not re-render though
* I have added http://localhost:3000
as a redirect URL (not sure if this is necessary)
* I have tried adding redirectUrl
property to redirect back to localhost, nada.
What am I doing wrong? Simplified code below
```
import { Auth, ThemeMinimal, ThemeSupa } from "@supabase/auth-ui-react";
import { createClient, Provider, Session } from "@supabase/supabase-js";
import { useEffect, useMemo, useState } from "react";
import { useSupabaseClient, useUser } from "@supabase/auth-helpers-react";
export default function Home() {
// can't use env variables, so using the non-hook client
const supabase = useMemo(() => {
return createClient(SUPABASE_URL, SUPABASE_KEY);
}, [SUPABASE_KEY, SUPABASE_URL]);
const user = useUser();
return (
<>
user '{user?.id}' <-- never renders
<Auth
magicLink
socialLayout="vertical"
supabaseClient={supabase}
appearance={{
theme: ThemeSupa,
}}
providers={enabledProviders}
/>
);
}smantha42
12/29/2022, 1:25 AMtext[]
. The CSV column has data in the form:
["c5bbf0a8-b2cc-48dc-84de-a5b34da139d6","40bd7511-a272-4a55-88c0-c31d95b77db1","e6e8ddc0-0f43-4737-83e2-002b635d38e7","457b1c81-1851-46e9-a429-1e1ea044aa35","40bd7511-a272-4a55-88c0-c31d95b77db1"]
Which if I were to manually enter into supabase Table Editor it works... but when it's in the CSV file, Supabase isn't able to ingest it. It reports the following error:
Table HivesDeux has been created but we ran into an error while inserting rows: Failed to run sql query: malformed array literal: "["12c0dec1-611f-450f-8ae7-0ee3a7374c36","16be4036-1e8b-45b2-bc69-9d660944aecf"]"
I've tried:
1. Wrapping the array elements in { }
2. Prefixing the [] with ARRAY
3. Replaced the " in CSV with '
I really don't want to manually enter multiple records using Table Editor.
Appreciate any help...pckimlong
12/29/2022, 4:44 AMMartin INDIE MAKERS
12/29/2022, 5:52 AM6ary
12/29/2022, 6:28 AMinsert
works fine. As the title says update
does not.
How can I have a policy for update
that updates the row when a users table user_id
matches the user_id
in the request.
curl -X "PATCH" "https://rvqaevlgtedzufmzxqur.supabase.co/rest/v1/users?user_id=eq.some_id" \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'apikey': 'key' \
-d $'{
"is_subscribed": "false"
}'
How would I translate this to a policy?