HorseShoe
09/03/2021, 2:26 AMHorseShoe
09/03/2021, 2:27 AMRorstro
09/03/2021, 4:29 AMHorseShoe
09/03/2021, 4:47 AMcopple
09/03/2021, 5:42 AMlsunkieder
09/03/2021, 8:07 AMe0
09/03/2021, 9:10 AMDBSR
09/03/2021, 9:13 AMjonmeyers
09/03/2021, 9:21 AMlx_23
09/03/2021, 10:32 AMlx_23
09/03/2021, 10:32 AMWaldemar
09/03/2021, 1:05 PMauth.role()
. But I can't see it in the docs. I only see auth.uid()
Is it new? I quickly watched the video but couldn't see it there too.Waldemar
09/03/2021, 1:11 PMsuppliers
and my users have roles like "Italy Sales Rep", so they should be able to see all suppliers
from Italy.silentworks
09/03/2021, 1:12 PMauth.role()
as this only have a few roles. Take a look at https://supabase.io/docs/guides/auth#policies-with-joins as an examplenikivi
09/03/2021, 1:19 PMnikivi
09/03/2021, 1:21 PMnikivi
09/03/2021, 1:29 PMnikivi
09/03/2021, 1:29 PMnikivi
09/03/2021, 2:13 PMconst handleSignIn = async (e) => {
e.preventDefault();
setError("");
setLoading(true);
const { error: signInError } = await supabaseClient.auth.signIn({
email,
password,
});
if (signInError) setError(signInError.message);
setLoading(false);
};
nikivi
09/03/2021, 2:14 PMnikivi
09/03/2021, 2:19 PMconst signInDetails = await supabaseClient.auth.signIn({
email,
password,
});
const signInError = signInDetails.error;
const signInUser = signInDetails.user;
nikivi
09/03/2021, 2:19 PMsignInUser
in cookies?nikivi
09/03/2021, 2:20 PMjon
09/03/2021, 2:20 PMjon
09/03/2021, 2:23 PMnikivi
09/03/2021, 2:49 PMnikivi
09/03/2021, 2:49 PMnikivi
09/03/2021, 2:52 PMexport default function Home() {
const { user } = Auth.useUser();
console.log(user);
return (
<>
{!user && (
<Auth
supabaseClient={supabase}
providers={["google", "github"]}
socialLayout="horizontal"
socialButtonSize="xlarge"
/>
)}
</>
);
}
nikivi
09/03/2021, 2:52 PMuser
will return the logged in user?nikivi
09/03/2021, 2:53 PM