rbkayz
10/31/2022, 9:22 PMtEjAs
10/31/2022, 9:51 PMCheqo
10/31/2022, 10:01 PMconst handleOtpVerify = async () => {
const { data, error } = await supabaseClient.auth.verifyOtp({
email,
token: otp,
type: 'magiclink'
});
It works perfectly with existing users, however, if user doesn't exist he will receive confirm your signup email(see the screenshot)?
Why?
Does that mean that I need to have 2 UI screens/pages - one for Create account other for Sign in with email?
Is it possible to handle this logic somehow with one email input field?Walid
10/31/2022, 11:49 PMbenyi3k
11/01/2022, 2:07 AMCody
11/01/2022, 3:04 AMinitialSession
on pageProps
is never populated. What do I need to do to make it so the session is used in SSR so that there is not a flash of content with the login page before quickly flipping to the Account page?<br/>
11/01/2022, 3:10 AM((()))
11/01/2022, 7:37 AMGreg
11/01/2022, 9:24 AMqlznxajtjhrqwebbryiu.supabase.co | 520: Web server is returning an unknown error
It's a bit tricky to handle errors when returned as HTML 😅 so I'm wondering if this is a known bug / if there's a better way for me to handle it / if there are common known causes for 520 errors?Bamsespartymix
11/01/2022, 12:24 PMtalpiven
11/01/2022, 11:44 AM49Ryann
11/01/2022, 12:11 PMnoahflk
11/01/2022, 1:14 PMconst { user } = await getUser(ctx);
from gSSP but that's no longer possible. How can I achieve this with the latest version?Lukas V
11/01/2022, 1:49 PMconst getUserDetails = () => supabase.from('users').select('*').single();
This supposed to retrieve currently logged in users public row in database, but I don't see uid
being passed anywhere, it literally reads like this:
get me first user in users table instead of *get me single user row that matches this uid*
is this a mistake or actually correct call somehow?ismael1234
11/01/2022, 3:10 PMimport { withMiddlewareAuth } from '@supabase/auth-helpers-nextjs'
export const middleware = withMiddlewareAuth({ redirectTo: '/login' })
export const config = {
matcher: ['/middleware-protected/:path*'],
}
in the file "middleware.ts" inside pages, also tried after in "_middleware.ts", and doesn't work. In the first file it doesn't do anything, in the second one it gives me many errors. Changing /middleware-protected/:path* to "comments or /" for example doesn't do anything.Brams
11/01/2022, 3:44 PMAzura
11/01/2022, 5:28 PMlog in with QR code
system and looking for a way to programmatically generate a new auth session to be used in a Next.js API route and pass it back to the other device that contains the QR code (the requesting device).
Does supabase currently support this use case? If not, is there any known workaround?
Thanks a lot!Domcario
11/01/2022, 5:38 PMsupabase.auth.getUser().created_at
is within 2 seconds of supabase.auth.getUser().last_sign_in_at
then safe to assume it's a new user?UCDFiddes
11/01/2022, 5:58 PMSmardrengr
11/01/2022, 6:04 PMinsert
a row in a table that, FWIW, has a constraint on two columns, e.g.:
create table players (
id uuid primary key DEFAULT gen_random_uuid(),
created_at timestamp with time zone default now(),
updated_at timestamp with time zone,
user_id uuid not null references auth.users,
game_id uuid not null references games(id),
num int default 0,
unique(user_id, game_id)
);
supabaseClient returns the error
{
code: '21000',
details: null,
hint: null,
message: 'UPDATE requires a WHERE clause'
}
Any ideas? (Upserting fails too the same way.)Thoth Trismegistus
11/01/2022, 6:06 PMjs
await supabaseClient.from('trackings').upsert({
user_id: $page.data.session?.user.id,
data: "same"
});
this creates multiple entrieszettabyte
11/01/2022, 7:49 PMSite URL
, GitHub Client ID
, and GitHub Client Secret
.
Are these docs outdated? Or is this step no longer necessary?Gary
11/01/2022, 7:58 PMjs
const [items, setItems] = React.useState(fetchItems, []);
const addItem= async () => {
let { data: item, error } = await supabase
.from("TableName")
.insert([{ user_id: user.id }])
.single();
if (error) setError(error.message);
else setItems([...items, item]);
};
I can fix this by adding my fetch function after setItems, but it re-renders the entire list of items instead of just adding 1. Is there a way around that? Thanks very much.Smardrengr
11/01/2022, 8:10 PMnum
of confirmed players
in the games
table each time a player record is created, updated or deleted. Here’s my non-working code:
drop function if exists games_players cascade;
create or replace function games_players()
returns trigger as $$ begin
update games set players_conf = (select sum(players.num) AS num from players where players.game_id = NEW.game_id group by players.game_id) where games.id = NEW.game_id;
return NEW;
end;
$$ language plpgsql;
Any ideas?Kelaos
11/01/2022, 8:13 PMkonga
11/01/2022, 8:49 PMturner
11/01/2022, 9:00 PMrls_user
(neither from the SQL Editor in the dashboard) to read from my tables. the user can connect to the database, but a select * from table_name
returns an empty array.
is there any documentation on how to properly add a user to the supabase postgres db? has anyone had the same issue?
I want a user to connect directly to the database instead of using supabase‘s postgRESR API. The user should be affected by RLS, I want to set the jwt claims at every session.InASunshineState
11/01/2022, 10:26 PMasset_data:images ( asset_id, height, metadata, public_id,tags, url,width),
folder_data:favorites_folders ( folder_id:id, folder_name ),
parent_folder_data: favorites_folders ( parent_folder_data:parent_id(parent_folder_id:id, parent_folder_name:folder_name) ) )
It returns each row with an asset_data object, folder_data object and parent_folder_data object.
I want it all sort of flat, like all the asset_data's individual properties like height, on the same nested level as folder_id, and also on the same level as parent_folder_id
Right now I use map() in Javascript and spread through each to handle them differently, but I was wondering if there was a wiser/smarter query to get it right out of the gate flattened.
The parent_id on favorites_folders is a foreign key relation to favorites_folders, and there's a table user_favorites which is the row ID and then a foreign key relation to the user table, and a foreign key relation from the stored asset_id there to the data it references in the images table.Cody
11/01/2022, 10:30 PM<Auth />
component from @supabase/auth-ui-react
, the styles are not added to the HTML, so the component is initially not styled. That's not the weird part, though. The weird part is that once it is styled and a class name is added which points to a set of styles that don't actually exist inside the DOM. When you inspect the elements, check the styles, and click on their source, it redirects you to an empty <style></style>
tag. I've never seen this before...Cody
11/01/2022, 10:43 PMwithMiddlewareAuth
from @supabase/auth-helpers-nextjs
, a redirectFrom
param is provided so you can use it to redirect back to the protected page. When logging in via the Google provider, the parameter is lost on the way back. What is the best way to achieve the ability to redirect back to the previous page when logging in via Google?