battlesheep123
01/05/2023, 4:43 PMPythonic
01/05/2023, 5:20 PMTo setup the database schema via Soda, run:
make migrate_test
And I'm running into this error:
{"level":"warning","msg":"WARNING: SAML is an incomplete feature and should not be enabled for production use!","time":"2023-01-05T12:15:07-05:00"}
{"level":"fatal","msg":"running db migrations: Migrator: problem creating schema migrations: couldn't start a new transaction: could not create new transaction: failed to connect to `host=localhost user=supabase_auth_admin database=postgres`: failed SASL auth (FATAL: password authentication failed for user \"supabase_auth_admin\" (SQLSTATE 28P01))","time":"2023-01-05T12:15:07-05:00"}
exit status 1
make: *** [Makefile:28: migrate_test] Error 1
Which makes me think that I need to change the database URL to something other than the default, but I don't know what I'm supposed to use:
c
GOTRUE_DB_DRIVER="postgres"
NAMESPACE="auth"
DATABASE_URL="postgres://supabase_auth_admin:root@localhost:5432/postgres"
API_EXTERNAL_URL="http://localhost:9999"
GOTRUE_API_HOST="localhost"
PORT="9999"
Any ideas?Smardrengr
01/05/2023, 5:56 PMforgot.svelte
page where users can, if they forget their password, ask for a password reset email (MagicLink) in order to sign in and update their password. (I'm use Supabase Auth Helpers.) I've got the email part working—Supabase signs them in when they click the link. But I'm not sure where and how to, in this case, redirect the browser to the reset.svelte
page... Like, in what file would I potentially add a throw redirect(303, '/reset');
?
THANKS!a guy
01/05/2023, 6:25 PMDATABASE_URL=connection string
. prisma migrate dev
timed out.
I tried psql <connection string>
, while following the supabase prisma guide. I get psql: error: could not translate host name "pswd@db.bloop.supabase.co" to address: nodename nor servname provided, or not known
I tried with a different service, not supabase, and the migration worked. I wanted to use supabase for as much as possible, not just auth, but am I understanding correctly from all the posts here that prisma & supabase is not presently the simplest combo around?
Any clues?Skoe
01/05/2023, 7:07 PMmiky2fois
01/05/2023, 7:12 PMkpradel
01/05/2023, 7:16 PMgaIaxy
01/05/2023, 7:51 PMJesuscc9
01/05/2023, 8:40 PMjakeAnon
01/05/2023, 9:05 PM-- Make sure the policy applies to the files bucket only
bucket_id = 'files' AND
-- Make sure they can only access their own folder within that bucket
(storage.foldername(name))[1] = public::text AND
-- Check the file name of the file and only allow delete if it matches the name below
storage.filename(name) = auth.uid()
Thank youCanRau
01/05/2023, 9:13 PMnumeric(5,5)
seemed reasonable, which from what I understand couldn't be >=1
right?
2. "General" percent in the sense that I want to be able to for example have 3 rows with each storing 1/3 which should add up to 100%.
0.3333.. wouldn't really work right, so either one has to be more like 0.34 so it add up to 100 or I store it differently?
1/3 is just an example, could be 1/2, 1/5, 3/5 etc.gregh.xyz
01/05/2023, 9:26 PMPythonic
01/05/2023, 9:39 PMts
import { client } from "$lib/util/supabase";
export const load = (async ({ url }) => {
const { data: user, error: err } = await client.from('athletes').select();
console.log(client, user, err);
if(err !== null) throw error(parseInt(err.code), err.message);
return { user };
}) satisfies LayoutServerLoad;
The log on the server shows exactly what I expect:
[
{
created_at: '2023-01-05T21:11:27.669346+00:00',
avatar: '***',
first_name: '***',
last_name: '***',
id: 18611857
}
] null
But on the client I get something completely different:
[] null
I printed the client on both sides to see that I got the same thing, but it seems that one of the clients doesn't have an Authorization header?
ts
createClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY, {
global: {
headers: {
Authorization: `Bearer ${token}`
}
}
})
headers: {
Authorization: '***',
'X-Client-Info': '@supabase/auth-helpers-sveltekit@0.8.6'
}
vs
headers: {
'X-Client-Info': '@supabase/auth-helpers-sveltekit@0.8.6'
}
coker
01/06/2023, 3:35 AMclients
table, and an on_auth_user_created
trigger to copy some of the data over to a public user_profiles
table.
For simplicity, the user_profiles
table has an id
, a user_id
, and a client_id
. A user should only be able to access the client that their user_profile
links them to.
The following policy will not let me query any clients. Currently, clients
is the only table that I have RLS enabled for. What am I missing?
pgsql
create policy "Users can access the Client they are assigned to"
on clients
for all using (
auth.uid() in (
select user_profiles.id from user_profiles
where client_id = clients.id
)
);
robkuz
01/06/2023, 5:16 AMINTERNAL_SERVER ERROR: 'ServerManager' object has no attribute 'user_info'
What can I do about this?DeepITM
01/06/2023, 5:58 AMHugoDuprez
01/06/2023, 9:17 AMdr. frank
01/06/2023, 9:47 AMLadlum
01/06/2023, 10:47 AMkresimirgalic
01/06/2023, 12:08 PMReact.useEffect(() => {
const messagesSubscription = supabase
.channel('message-channel')
.on(
'postgres_changes',
{ event: 'INSERT', schema: 'public', table: 'groups_message' },
(payload) => {
setMessagesData((oldMessages) => [...oldMessages, payload.new]);
}
)
.subscribe();
return () => {
messagesSubscription.unsubscribe();
};
}, []);
rbkayz
01/06/2023, 1:56 PM1chbinamin
01/06/2023, 2:10 PMRAOUL
01/06/2023, 3:09 PMAlf
01/06/2023, 3:35 PMwarflash
01/06/2023, 4:06 PMaudit_log_entries
can safely be deleted to regain disk space. At the moment its taking up over 60% of our disk which is not really favorable imo.
Thank you!larryM
01/06/2023, 4:12 PMauth.signIn
or auth.refreshSession
, this error is thrown :
Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [StringCodingKey(stringValue: "user", intValue: nil), StringCodingKey(stringValue: "identities", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), StringCodingKey(stringValue: "created_at", intValue: nil)], debugDescription: "Invalid date format: 2022-11-25T00:00:00Z", underlyingError: nil))
anggoran
01/06/2023, 4:26 PMdart
await supabase.from('documents')
.stream(primaryKey: ['id'])
.listen((List<Map<String, dynamic>> data) {
// Do something awesome with the data
});
Respect to that, so should I do like this?
dart
await supabase.from('documents')
.stream(primaryKey: ['id'])
.listen((List<Map<String, dynamic>> data) {
// final salesIDList = get all sales ids;
await supabase
.from('sales')
.select()
.in_('id', salesIDList);
});
Relisora
01/06/2023, 4:39 PMsql
select battle.season
from battle
inner join team on battle.id = team.battle_id
where wizard_id = 2175612
AND battle.public IS TRUE
group by battle.season
It takes sometimes more than 2s to respond!Michael Maust
01/06/2023, 5:07 PMluke90275
01/06/2023, 6:03 PMjs
await supabase.auth.signIn(
{
provider: 'google',
},
{ redirectTo: '/dashboard' }
);
Any idea whats happening here?