Bonteq
10/22/2022, 6:43 PMBonteq
10/22/2022, 6:49 PMDatabase Function
alongside a Database Trigger
to generate public.users
in my database whenever a new auth.user
is created.
This creation occurs on sign in using supabase.auth.signIn({ provider: 'twitch' })
.
The problem I'm hoping to solve is that I'd like to extract additional data from the Twitch provider on account creation, specifically their username.
How do I dig into their response further while signing in + creating a user?vicary
10/22/2022, 7:15 PMsupabase.auth.getUser()
, is it possible to skip the user fetch and only verify the access token?chokeul8r
10/22/2022, 7:35 PMmynamejeff
10/22/2022, 7:51 PMvicary
10/22/2022, 9:34 PMjon
10/22/2022, 9:40 PMsupabase.auth.getUser()
is throwing an invalid claim: subject missing
error in my logs and returning a 500
on the client.
I'm trying to figure out what I might be doing wrong here, but it's sufficiently cryptic that I'm not sure where to start. Could anybody help shed some light?
Thanks!Lukas V
10/23/2022, 12:41 AMconst { data, error } = await supabase
.from<ProductTypeHere>('products')
But now, it supposed to know the types automatically when initialize client like this:
import type { Database } from 'types_db';
export const supabase = createBrowserSupabaseClient<Database>();
But, as you can see from the picture, I get any[] | null
as a return instead of my database type.
How can I get return types for my data?Unknown Member
10/23/2022, 3:04 AMRocinante
10/23/2022, 8:32 AMTS
const logInWithSocialProvider = (provider: "google" | "facebook") => supabase.auth.signInWithOAuth({
provider: provider,
options: {
redirectTo: `${origin}${$path('/account/oauth/callback')}`,
}
});
bhaybs
10/23/2022, 8:35 AMLou | XBorg
10/23/2022, 9:26 AMRicardowj
10/23/2022, 9:53 AMShoaib
10/23/2022, 10:04 AM49Ryann
10/23/2022, 10:39 AMError: Failed to update an existing Function's body on the Supabase project: {"message":"The function size exceeds the allowable limit"}
alx90
10/23/2022, 11:01 AMSmyrii
10/23/2022, 12:00 PMconst payload = {
userId: session.user.sub,
exp: Math.floor(Date.now() / 1000) + 60 * 60,
};
session.user.accessToken = jwt.sign(
payload,
process.env.SUPABASE_SIGNING_SECRET
);
I'm sending the JWT (access token) when trying to get table data
async getServerSideProps({ req, res }) {
const {
user: { accessToken },
} = await getSession(req, res);
const supabase = getSupabase(accessToken);
const { data: notes } = await supabase.from("Notes").select("*");
return {
props: { notes },
};
},
But even when there user_id should match and return some results it does not. Here is my SQL below:
create or replace function auth.user_id() returns text as $$
select nullif(current_setting('request.jwt.claims', true)::json->>'userId', '')::text;
$$ language sql stable;
and my select policy
(user_id() = user_id)
Any idea's on why this won't work? Thanks!doxara
10/23/2022, 12:01 PMthomas_mol
10/23/2022, 12:58 PMflutter: ***** SupabaseDeepLinkingMixin startAuthObserver
[VERBOSE-2:dart_vm_initializer.cc(41)] Unhandled Exception: AuthException(message: refresh_token required, statusCode: 400)
#0 GotrueFetch.request
package:gotrue/src/fetch.dart:99
<asynchronous suspension>
#1 GoTrueClient._callRefreshToken
package:gotrue/src/gotrue_client.dart:588
<asynchronous suspension>
Seems to be a problem getting a refresh token. This happens when I do nothing in the app (just have it open, not interacting with the app at all).
Any ideas?Captain
10/23/2022, 1:02 PMjavascript
try {
const { data, error } = await supaClientAnon.auth.signUp({
email,
password
});
if (error) {
res.status(422).json({ message: error.message });
return;
}
const sess = await supaClientAnon.auth.setSession(data?.session as Session);
return res.status(201).json({ message: 'Signed up!', data, sess });
} catch (error) {
res.status(500).json({ message: 'Something went wrong' });
return;
}
talpiven
10/23/2022, 3:22 PMSolemensis
10/23/2022, 8:41 PMAxelbgds
10/23/2022, 6:49 PMfreshandlow
10/23/2022, 8:05 PMkuroro
10/23/2022, 8:49 PMcreateClient
during each request? Or should I only call it once and then cache the object for further use in subsequent requests? I guess this is meant for non-serverless setups where each request is handled on same process.VWL Tobias Hassebrock
10/23/2022, 8:56 PMevent: "phx_reply"
payload:
response: {reason: "error occurred when joining realtime:public:<table-name>"}
reason: "error occurred when joining realtime:public:<table-name>"
status: "error"
ref: "1"
topic: "realtime:public:<table-name>"
Any ideas what could cause this? I also found this bug report on github but I do not understand it: https://github.com/supabase/realtime/issues/217
I also created a stackoverflow post:
https://stackoverflow.com/questions/74175531/supabase-realtime-error-occurred-when-joining-realtimepublictable-nameendigma
10/23/2022, 10:56 PMAustin
10/23/2022, 11:48 PMUnknown Member
10/23/2022, 11:49 PM