Whoman
05/07/2023, 4:28 PMTal Mikey
05/07/2023, 4:33 PMbrassotron
05/07/2023, 5:05 PMreachlinlen
05/07/2023, 5:12 PMjdgamble555
05/07/2023, 8:52 PMts
const { error } = await supabase.auth.updateUser({ email });
However, nothing happens except for new_email
gets updated. I don't want to require confirmations on localhost, and my localhost doesn't seem to send out confirmations... so in reality it is two problems.
config.toml
py
[auth.email]
# Allow/disallow new user signups via email to your project.
enable_signup = true
# If enabled, a user will be required to confirm any email change on both the old, and new email
# addresses. If disabled, only the new email is required to confirm.
double_confirm_changes = false
# If enabled, users need to confirm their email address before signing in.
enable_confirmations = false
Jindymaat
05/07/2023, 9:24 PMsb
05/07/2023, 11:25 PMsupabase.auth.admin.generateLink
and then do router.push(magicLink)
.
We're facing an issue where the browser navigation stack is corrupted (our app -> supabase url -> our app) which means that when a user logs in, goes to a route, then clicks back (router.back), it removes them from our application. This leads to a confusing flow for a logged in user.
The ideal solution is to be able to log in the user via the server-side. For example: const response = fetch('/api/otp-login')
, wherein the supabase client adds the proper authorization headers to the user's cookies / request headers. Is this possible?ethanfox
05/07/2023, 11:43 PMimport type { PageData } from './$types';
export let data: PageData;
To a component so I can read, write, and update from a component rather than just a +page in Sveltekit?
I have nested components in order to make things easier to read/follow but there is only an example in the SvelteKit Auth Helpers involving a +page.svelte and no svelte component. Is this possible?
When using method provided in the JS SDK documentation the RLS kicks in and prevents any updates since there is no session.okxiaoliang4
05/08/2023, 2:11 AMSassan
05/08/2023, 2:17 AMSANTlAG0
05/08/2023, 2:30 AMconst { data, error } = await supabase
.from("profiles")
.select(
`
credits,
accounts: user_id (
account_name
)
`
)
.eq("id", user.id)
.single();
However is not working and im not sure why.
My account table has a field the following field
constraint accounts_user_id_fkey foreign key (user_id) references auth.users (id),
The profile.id is the same as the user_id
Can someone help me how to get this to work?Aditya Tripathi
05/08/2023, 6:03 AMhttps://cdn.discordapp.com/attachments/1105012149002195014/1105012149132214292/image.png▾
vinciarts
05/08/2023, 6:36 AMTal Mikey
05/08/2023, 7:22 AMnpx supabase db remote commit
and got this error : failed to connect : failed SASL auth (FATAL: SASL authentication failed (SQLSTATE 08P01)).
Any ideas?lennard.
05/08/2023, 7:43 AMRytterboi
05/08/2023, 8:11 AMRB_Gaura
05/08/2023, 8:24 AMSarcodo
05/08/2023, 10:24 AMsignUp: ({ email, password }) => {
console.log({ email, password });
return supabase.auth.signUp({
email,
password,
options: {
data: {
hi: 'Will',
age: 10
}
}
});
},
Which lives in an <AuthContext>
component which wraps the app, but the signup doesn't get called, looks like it's due to the Auth
component handling it's own login / signup stuff through supabase.auth.onAuthStateChange
. So what's the best way to add user meta data when using that Auth
componentGRACKATTACK
05/08/2023, 10:28 AMCorton
05/08/2023, 11:25 AMnext_auth.users
table.
When using a service_role
token, I can query and mutate with the graph because I have configured it to expose the graph on the project settings. However, when I use an authenticated
token, I can not do anything as the graph seems not exposed to authenticated users.
I have granted SELECT and UPDATE to authenticated users:
select
pg_catalog.has_table_privilege('authenticated', 'next_auth.users', 'SELECT') as has_select,
pg_catalog.has_table_privilege('authenticated', 'next_auth.users', 'UPDATE') as has_update;
this returns true for both has_select
and has_update
.
I have enabled RLS to restrict users from updating other records.
This is the result of the mutation:
{
"data": null,
"errors": [
{
"message": "Unknown field \"updateusersCollection\" on type Mutation"
}
]
}
fred kufner
05/08/2023, 12:41 PMhttps://cdn.discordapp.com/attachments/1105112202542862388/1105112202698039296/CleanShot_2023-05-08_at_08.40.10.png▾
ven
05/08/2023, 1:30 PM-- -- table public.contact_me
alter table public.contact_me force row level security;
in the SQL studio. I get a success. no rows returned
message.
when i tab over to the tables view in the studio and select the contact_us table it flashes "no RLS enabled on the table". Its weird because i have 4 tables in the db right now and I have successfully enabled rls on 2 of them using the same command. I have this same issue on another table. any thoughts? thanksNin
05/08/2023, 1:34 PMsql
WITH input_coords(q, r) AS (
VALUES
(0, 0), (0, -1), (1, -1), (1, 0), (0, 1), (-1, 1), (-1, 0), (0, -2), (1, -2), (2, -2), (2, -1), (2, 0), (1, 1), (0, 2), (-1, 2), (-2, 2), (-2, 1), (-2, 0), (-1, -1), (0, -3), (1, -3), (2, -3), (3, -3), (3, -2), (3, -1), (3, 0), (2, 1), (1, 2), (0, 3), (-1, 3), (-2, 3), (-3, 3), (-3, 2), (-3, 1), (-3, 0), (-2, -1), (-1, -2)
)
SELECT
g.id,
g.coords,
g.moisture,
g.elevation
FROM
public.grid g
JOIN input_coords ic ON (g.coords).q = ic.q AND (g.coords).r = ic.r;
How would I transform this to a function where the values are dynamic?towc
05/08/2023, 1:53 PMauthenticated
users should be able to update
their own row, but only specific columns.
It's easy to create a policy to allow thse users to update
their own row, but I can't figure out how to prevent them from changing critical columns, like id
or the plan
they're subscribed to.
We have small configuration columns like color_scheme
, which if we can avoid having to go through our backend to modify, it would be nice. We do use these columns in the backend occasionally, storing them client-side only is not great. And the less code we have to change after enabling RLS, the better. So if we only have to add an RLS policy, that would be great.
I hoped it could be solved by checking the critical columns in the USING
or WITH CHECK
clauses, e.g. (new.id = old.id) and (new.plan = old.plan)
, but new
and old
don't seem to be available within those clauses.
Any ideas?zerefati
05/08/2023, 2:06 PMhttps://cdn.discordapp.com/attachments/1105133509519081503/1105133509837856898/Screenshot_2023-05-08_at_5.04.16_PM.png▾
иuғe
05/08/2023, 2:07 PMhttps://cdn.discordapp.com/attachments/1105133848469180517/1105134159543934976/image.png▾
ven
05/08/2023, 2:21 PMven
05/08/2023, 2:30 PMinfinity
05/08/2023, 2:44 PMceN
05/08/2023, 2:56 PM