Chris_Acrobat
07/18/2022, 8:23 AMSiddharth
07/18/2022, 10:08 AMtcurdt
07/18/2022, 10:57 AMpepperbeam49
07/18/2022, 1:16 PMRobson
07/18/2022, 2:08 PMuser
07/18/2022, 3:22 PMsb
07/18/2022, 4:23 PMbig2tiny
07/18/2022, 5:09 PMzenny.eth
07/18/2022, 5:10 PMEthanxyz
07/18/2022, 7:22 PMreports
bonds
report_bonds
Reports are basically just a list of bonds, or a list of documents.
In my UI I want to display specific bond information. I know that instead of running another function, I can use something like this...
js
const { data: report, error } = await supabase
.from("reports")
.select("*, report_bonds(*)")
.eq("id", params.id)
.single();
... in hopes that it will give me back a nested obj containing all the bond
information / details to render to my UI.
But, I get the error, Could not embed because more than one relationship was found for 'reports' and 'reports_bonds'
It is true that my reports_bond
table has 2 FK, bond_id
and report_id
( I need both ).
I have looked for answers online and in the documents but I cannot seem to get anything to work. I even tried removing 1 of the 2 FKs in the report_bond
table, but I still get the same error
Any ideas on how I can go about this ?Kolby
07/18/2022, 7:44 PMonAuthStateChange
to set an auth cookie
- I'm checking for the cookie in an edge function to guard protected routes /dashboard
- After signing up/in I redirect users to the dashboard page
- Redirecting was happening before auth cookie was set, so the edge function forwarded them away
- I fixed this by listening for event === 'SIGNED_IN'
, and after auth cookie is set, I redirect to /dashboard
- Worked great for signing in, but when a user signs up I first create the user, and then I create an additional row in another table
- The user is being redirected before the additional row is created because event === 'SIGNED_IN'
is being triggered
So, is there anyway to sign up without triggering sign in? Or is there a solution to one of these problems I'm not seeing?hanako
07/18/2022, 7:49 PMjar
07/18/2022, 8:55 PM<SupaAuthHelper> is not a valid SSR component
Idk if need to add something in svelte.config.jsNeedle
07/19/2022, 12:21 AMitsjbecks
07/19/2022, 12:36 AMNeedle
07/19/2022, 3:26 AMAlanK
07/19/2022, 5:46 AMbenten
07/19/2022, 6:53 AMNanoBit
07/19/2022, 7:37 AMauth.role() = 'authenticated'
works however, TO authenticated
in RLS policy does not work FOR Prisma Client. (Supabase Client works for both)
More details in threaddanielcoglitore
07/19/2022, 9:32 AMNARCISO
07/19/2022, 10:19 AMlocally
hosted Edge Function inside a PSQL Function
with the pgsql-http
extension?
I tried to POST the local Edge Function and I got *connection refused*: "Failed to connect to localhost port 54321: Connection refused"
Database function extracted:
BEGIN
...
SELECT status FROM http_post('http://localhost:54321/functions/v1/<functionname>', ...);
...
END
Is there maybe a Docker alias of the Edge Function service?kinau
07/19/2022, 10:42 AMaar2dee2
07/19/2022, 11:03 AMts
//import from packages
import React from "react";
import { Auth } from "@supabase/ui";
import { supabaseClient } from "@supabase/auth-helpers-nextjs";
//import from context and utils
//import from components
//import assets
export default function AllLoginOptions() {
return (
<div className="all-login-options">
<Auth
supabaseClient={supabaseClient}
providers={["google"]}
socialLayout="horizontal"
socialButtonSize="large"
className="text-warmwhite"
redirectTo={`app.${process.env.APP_DOMAIN}/dashboard`}
></Auth>
</div>
);
}
I've changed the Site url for auth redirects in my the Supabase Project Authentication settings to my production domain. I've also added localhost
to the list of allowed redirect urls. However, when I login in during dev (on localhost), the redirect happens to the production domain after auth. How can I redirect to localhost
?
Note: the APP_DOMAIN
environment variable is set as localhost
in dev, and as the production domain in prod.React noob
07/19/2022, 11:31 AMMax52
07/19/2022, 1:27 PMSTILLWATER;
07/19/2022, 1:35 PMjordan801
07/19/2022, 4:39 PMNeedle
07/19/2022, 5:39 PMAris
07/19/2022, 5:51 PMawait supabase.auth.signIn({email})
This triggers an email, and when the verification link is clicked, it redirects to http://localhost:5173/#access_token=[...]&expires_in=3600&refresh_token=[...]&token_type=bearer&type=magiclink
AFAIK that Supabase -> GoTrue -> redirect flow should set browser cookies, but that's not happening and I'm not sure whySajeev
07/19/2022, 7:08 PM