oski啦
10/09/2022, 8:46 AMfenix
10/09/2022, 11:12 AM0xtouseef
10/09/2022, 11:58 AMProperty 'signIn' does not exist on type 'SupabaseAuthClient'.
for this code:
export async function signInWithGoogle() {
const { user, session, error } = await supabase.auth.signIn({
provider: "google",
});
}
Profilüfter
10/09/2022, 12:55 PMCREATE EXTENSION pg_cron;
I get the following error:
Error: Error starting database: ERROR: can only create extension in database postgres
DETAIL: Jobs must be scheduled from the database configured in cron.database_name, since the pg_cron background worker reads job de
scriptions from this database.
HINT: Add cron.database_name = 'main' in postgresql.conf to use the current database.
CONTEXT: PL/pgSQL function inline_code_block line 4 at RAISE
It's probably because the Supabase CLI creates a database named after the current branch (default main
) and only later renames it to postgres
.
Is there a way around this? If I try to enable the extension after I started the server it does work however I need to be able to use it in migrations.niceplugin
10/09/2022, 2:13 PMedo
10/09/2022, 2:53 PMA client logs in and then requests some information from the server.
The server retrieves the `access_token` for the user and gets the information
The server sends the information back to the client
A few questions:
1. How does the client makes an authenticated request to the server?
From [this](https://github.com/supabase/supabase/discussions/1094) thread, my understanding is that I need to send a JWT to the server, and then the server needs to create a new Client (via supabase-js
for example) and that will tell me which user is making the request.
2. Once I know the user that is making the request, I want to retrieve her tokens from the database. From my googling, it doesn't look like I can modify the table where the user information is stored auth.users
, so what is the best way to go about this? Should I create a new table that contains the id
of the user and the relative tokens? Do I do this from the web console of Supabase?Talajax
10/09/2022, 3:14 PMlet { data, error, status } = await supabase
.from("profiles")
.select(`username`)
.eq("id", id)
.single();
if (error && status !== 406) {
throw error;
}
if (data?.username) {
router.push({ pathname: "/[account]", query: { account: id } });
return;
}
At the [account].tsx page i'm receiving the id and making another query to 'profiles' to get user data, but this time i'm also getting the property avatar, which in my schema is defined as 'text'. But i'm receiving this error when i try to retrieve the avatar. The "4bc97434-c7a5-4a5e-a32d-e1c66a6a588e" is my user.id. After i uploaded the image to storage i retrieve it's url by getPublicUrl and updated the avatar property of the user. I don't understand what am i doing wrong here.lewisd
10/09/2022, 5:17 PMlocalhost:3000
as my site URL and my apps deeplink url has been added to the Redirect URLs
list.
When a user verifies their email, they're currently sent to localhost:3000/...
I imagine ill change this to my website url when i go live. But im wondering how I would handle sending the user back to the mobile app instead of my website url, if they signed up from there?ClumsyPenguin
10/09/2022, 6:05 PMThoth Trismegistus
10/09/2022, 6:25 PMsupabase.channels
methodunpin
10/09/2022, 6:30 PMWaberHoruhe
10/09/2022, 6:33 PMfloyare
10/09/2022, 7:47 PMSELECT
only if it's his profile. Anybody know how can I do that by RLS Policy?TranquilMarmot
10/09/2022, 10:55 PMsupabase db remote changes
But it just sits there with this message at 0% forever:
Generating changes on the remote database since the last migration...
I have no local schemas or migrations. There doesn't seem to be anything in the docs about doing this; the local development page (https://supabase.com/docs/guides/cli/local-development) only seems to have instructions for pushing changes from local -> remote매튜
10/09/2022, 10:58 PMuser8923
10/10/2022, 12:18 AMvjoohov
10/10/2022, 1:31 AMcbunge3
10/10/2022, 4:35 AMsuroh
10/10/2022, 8:44 AMjs
let query = supabase
.from('recipes')
.select(
'*, ingredients:recipe_ingredients(*, ingredient:ingredients(name)), qry:recipe_ingredients!inner(*, ingredient:ingredients(name))'
)
.eq('qry.ingredient_id', 1)
For now my data structure of a single recipe looks something like this :
js
{
"id": "17805382-150d-4dad-842a-15905f03c732",
"name": "recipe name",
"ingredients": [
{
"recipe_id": "17805382-150d-4dad-842a-15905f03c732",
"ingredient_id": 1,
"quantity": 6,
},
{
"recipe_id": "17805382-150d-4dad-842a-15905f03c732",
"ingredient_id": 10,
"quantity": 5,
}
]
}
I tried combining queries from an array in a for loop, but this doesn't return any results when more than one item query is added :
js
let query = supabase
.from('recipes')
.select(
'*, ingredients:recipe_ingredients(*, ingredient:ingredients(name)), qry:recipe_ingredients!inner(*, ingredient:ingredients(name))'
)
for (let f of filter) {
query = query.eq('qry.ingredient_id', f)
}
const { data, error } = await query
Any assistance would be most welcome. 😖Talajax
10/10/2022, 11:12 AMconst { data, error } = await supabase.storage
.from('avatars')
.download(path)
if (error) {
throw error
}
const url = URL.createObjectURL(data)
49Ryann
10/10/2022, 12:49 PMHussein Kizz
10/10/2022, 3:05 PMThoth Trismegistus
10/10/2022, 3:21 PMThoth Trismegistus
10/10/2022, 3:57 PMJolt
10/10/2022, 4:10 PM10/Oct/2022:16:03:13 +0000: {"details":"connection to server at \"0.0.0.0\", port 5432 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?\n","code":"","message":"Database connection error. Retrying the connection."}
time="2022-10-10T16:03:15Z" level=fatal msg="running db migrations: Migrator: problem creating schema migrations: couldn't start a new transaction: could not create new transaction: failed to connect to `host=0.0.0.0 user=postgres database=postgres`: dial error (dial tcp 0.0.0.0:5432: connect: connection refused)"
I've tried different host names and ports. Eg. localhost
, 0.0.0.0
, 127.0.0.1
, and 54322
, but to no avail.
On the previous install of postgres I created a new superuser with password etc. to see if it was a problem with that, but it wasn't, as well as creating a new database (editing env etc.)
Anyone have any ideas?nitinmurali
10/10/2022, 4:12 PMfloyare
10/10/2022, 4:15 PMrole
if role is 1
INSERT
request will be allowed. Anybody knows how can I do that with policies?anderjaska
10/10/2022, 5:44 PMcbunge3
10/10/2022, 6:19 PMJoseph
10/10/2022, 7:44 PM