AVEN
02/03/2023, 10:51 AMcharacters
with 1 row, when I open a page on my site it sends this query to the database: await locals.sb.from('characters').select('*');
. This returns an empty array in data
.
I don't have any permissions locking any public tables right now and the user is authenticated.
locals.sb
is a TypedSupabaseClient
and right before the query I am checking if the session is valid and the user is authenticated.Neelay
02/03/2023, 12:26 PMdrewbie
02/03/2023, 12:36 PMHugoDuprez
02/03/2023, 12:59 PMKilian
02/03/2023, 1:07 PMauth.api.signInWithEmail
(see https://github.com/arpitdalal/remix-supabase-auth/blob/main/app/api/supabase-auth.server.ts#L80 ) auth.api no longer seems to exist in v2 so I'm unsure what the upgrade path here is. Any tips?Leky
02/03/2023, 1:53 PMdev Joakim Pedersen
02/03/2023, 1:56 PMTrevvy
02/03/2023, 2:15 PMAuthRetryableFetchError: Unexpected token o in JSON
. I came back 2 hours later to try and figure out what was happening, yet I was unable to re-produce. So was this something on Supabases side? Was also getting 500 status codegoldyman
02/03/2023, 2:30 PMBilboHicks
02/03/2023, 4:11 PMINBUCKET_SMTP_DISCARDDOMAINS=mailslurp.com
should do the trick but I can't figure out how to set this permanently inside the Docker container.
Anyone know how to do this?Roko
02/03/2023, 4:13 PMjinsley8
02/03/2023, 4:34 PMjs
// row 1
{
"key1": "value1",
"key2": "value2",
}
// row 2
{
"key1": "value1",
"key2": "value5",
}
My filters are a group of checkboxes. I want to show the total results beside each filter option like:
Key1 - Filter
-- Value1 (count total)
-- Value2 (count total)
-- Value3 (count total)
Key2 - Filter
-- Value1 (count total)
-- Value2 (count total)
-- Value3 (count total)
Is there an optimal way to achieve this count for each value? I'm learning PostgreSQL so not sure of the best way to approach this.pers0n
02/03/2023, 4:47 PMTypeError: _utils_supabase__WEBPACK_IMPORTED_MODULE_1__.supabase.auth.user is not a function
And if I pass it as not a function (just supabase.auth.user) I get returned undefined
This is my index.js file where I am calling it:
js
import { supabase } from '../utils/supabase'
export default function Home({ lessons }) {
console.log(supabase.auth.user());
return (
<div className="w-full max-w-3xl mx-auto my-16 px-2">
Test
</div>
);
}
I followed the docs here https://supabase.com/docs/reference/dart/auth-updateuser but it didn't work for me. I just want to log the current signed in user.DisamDev
02/03/2023, 4:53 PMashman
02/03/2023, 5:33 PMLioker
02/03/2023, 5:37 PM.davdi
02/03/2023, 7:13 PMgetServerSideProps
in NextJS with supabase auth? Is it possible at all?
My code currently look like this, but obviously this just returns me undefined
js
export async function getServerSideProps() {
const user = await supabase.auth.getUser().data;
return {
props: {
user: user,
},
};
}
kuna
02/03/2023, 7:18 PMgaryaustin
02/03/2023, 7:38 PMKremBanan
02/03/2023, 8:06 PMJames Q Quick
02/03/2023, 8:30 PMAliCodes!
02/03/2023, 8:32 PMjoin
across multiple tables would be really awesome!kyds3k
02/03/2023, 9:36 PMchannel.subscribe().send({
type: 'broadcast',
event: 'question-reveal',
payload: {
message: 'question-active'
}
})
It works the first time, but every time after it tells me:
Uncaught (in promise) tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance
Is there a way to check for subscription to a channel beforehand? Or do I need to unsubscribe first?Atrox
02/03/2023, 10:28 PMtitle
field from the projects
table:
ts
const { data } = await supabase
.from('projects_profiles')
.select(`project:projects(*)`)
.order('title', {
ascending: true,
foreignTable: 'projects',
});
No matter what I've tried, I cannot get ordering to work through a foreign table.goldyman
02/03/2023, 10:38 PMdart
Future<void> saveAvatar(Uint8List avatar) async {
try {
final avatarFile = File.fromRawPath(avatar);
await _supabaseClient.storage.from('avatars').upload(
'${_supabaseClient.auth.currentUser!.id}.png',
avatarFile,
);
await _supabaseClient.from('users').update({'hasAvatar': true}).match(
{'id': _supabaseClient.auth.currentUser?.id},
);
} catch (error, stackTrace) {
Error.throwWithStackTrace(
SupabaseSaveAvatarFailure(error),
stackTrace,
);
}
}
I get an exception Cannot open file
No Such file or directory.
I'm not sure if generating a File from uint8List is ok for supabase. Is it breaking in the client or in remote. It looks like it's in remote, cause I see log of trying to post to
"/object/list/avatars"
My policy for insert in this bucket is
((bucket_id = 'avatars'::text) AND ((uid())::text = (storage.foldername(name))[1]))
dvd
02/03/2023, 10:52 PMnateland
02/03/2023, 10:57 PMShawn Conecone
02/04/2023, 12:10 AMvjoohov
02/04/2023, 1:05 AMDanMossa
02/04/2023, 1:42 AMauth.users
which then cascades throughout the database.
sql
CREATE FUNCTION delete_account() RETURNS void
SECURITY DEFINER
LANGUAGE sql
AS
$$DELETE
FROM auth.users u
WHERE u.id = auth.uid();$$;
When the code runs, I'm getting an error back stating Unhandled Exception: AuthException(message: User not found, statusCode: 404)
The weird part is that I see the user being deleted from auth.users
as well as everywhere else in my database.
I'm not sure what's going wrong. Any ideas would be helpful!
Thanks!