Bryson_W
04/24/2022, 3:41 PMBryson_W
04/24/2022, 4:18 PMsilentworks
04/24/2022, 8:12 PMBryson_W
04/24/2022, 10:17 PMBryson_W
04/24/2022, 10:17 PMBryson_W
04/25/2022, 5:16 AMBryson_W
04/25/2022, 5:16 AMsilentworks
04/25/2022, 7:38 AMVidski
04/25/2022, 11:22 AMVidski
04/25/2022, 11:30 AMkaiba
04/25/2022, 5:45 PMcore
04/25/2022, 11:35 PMStudywithdesign
04/26/2022, 7:43 AMconst { data: posts, error } = await supabase.from("students").select("id, name, study(tutorial_id)");
in which study is the referencing table for many to many relationships. But when I fetch study(tutorial_id)
it gives me an array. I just want specific tutorial_id where the user matches the rowgaryaustin
04/26/2022, 2:28 PMstnmonroe
04/27/2022, 2:56 AMomri
04/28/2022, 12:52 PMsupabase.auth.setAuth
?
const { user } = supabase.auth.setAuth(myAccessToken)
seems to save the access token in the client but it doesn't fetch the user data which we use to check if the user is logged in (and which also allows us to take advantage of RLS, without an active user we get no data on api calls with RLS enabled).
i've checked my access token, it seems to be a valid jwt containing my account data.
it's acquired by manually opening $MY_SUPABASE_URL/auth/v1/authorize?provider=google&redirect_to=$MY_REDIRECT_URL
using browser.identity.launchWebAuthFlow
in a browser extension (where we can't have the supabase client manage its own windows) and then parsing the returned redirect url.
am i missing something?omri
04/28/2022, 12:53 PMsetAuth
to manually restore session data from browser.storage
on startup, since it's recommended for use in extensions over localStorage
.omri
04/28/2022, 12:54 PMts
export const supabase = createClient(supabaseUrl, supabaseKey, {
autoRefreshToken: true,
shouldThrowOnError: false,
});
omri
04/28/2022, 1:13 PMts
supabase.auth.setAuth(accessToken);
const { user, error } = await supabase.auth.api.getUser(accessToken);
// user is non-null
but when `console.log`ing the supabase client it seems like its auth.currentSession.user
property is still null
, will that prevent me from making authenticated api calls?omri
04/28/2022, 1:15 PMts
supabase.auth.setAuth(accessToken);
const { user, error } = await supabase.auth.api.getUser(accessToken);
const session = supabase.auth.session();
if (session) {
session.user = user;
}
console.log(supabase);
then the auth.currentSession.user
property shows up just fine.
should i be doing this?gehrig
04/28/2022, 9:37 PMkaaloo
04/29/2022, 10:19 AMVidski
04/29/2022, 12:38 PMkaaloo
04/29/2022, 12:47 PMVidski
04/29/2022, 12:51 PMVidski
04/29/2022, 12:52 PMVidski
04/29/2022, 12:52 PMkaaloo
04/29/2022, 12:59 PMLucas T
04/29/2022, 2:47 PMkaaloo
04/30/2022, 8:09 AM