blurblur
12/15/2022, 12:26 PMsigma-andex
12/15/2022, 3:52 PMcookie.setCookie
to set the cookie on the response, and it is in the response that I return, but the cookie doesn't seem to be forwarded from the gateway..xenon
12/15/2022, 5:12 PMWizzel
12/15/2022, 6:01 PMdart
final token = Supabase.instance.client.auth.currentSession?.refreshToken;
I copy and pasted this value(for now) and set it as a parameter on the server:
Inside the servers middleware, I set
dart
await supabase.auth.setSession(refreshToken);
to use the users credentials on the server.
Questions
1) I have read that I can verify an accessToken by using the JWT secret of my project to make sure the request if from a real user. However, I am a bit confused here because the .setSession()
requires a refreshToken. Do I need to send both the accessToken and the refreshToken to the server? If not, how can I authenticate the user on the server?
2) How/where do I set the tokens value? Do I include it in the request header?Pure
12/15/2022, 8:50 PMKT
12/15/2022, 9:11 PMDies.Irae
12/16/2022, 3:28 AMMorenoMdz
12/16/2022, 4:10 AMDamir
12/16/2022, 7:53 PMenyo
12/16/2022, 9:31 PMprofile
table) on the account page, so I'd like to add some of this data to the session.
Is there a way to do that?ethanfox
12/17/2022, 12:16 AMmick
12/17/2022, 4:43 AMALTER VIEW [view] OWNER TO authenticated;
When I tried to implement this, I get an error stating:
Failed to run sql query: must be member of role "authenticated".
I think this might be related to the change to SQL Editor user roles to postgres, rather than a super user. Can any one give me some advice on how to change the view owner to the user calling the view?
Update:
I have granted the authenticated role to the postgres user, and am now getting the error:
Failed to run sql query: permission denied for schema public
I have attempted to add all permissions on schema public to the postgres user, however the error continues.Lingxi
12/17/2022, 6:28 AMSpikeSaber
12/17/2022, 10:12 AMmancku
12/17/2022, 10:26 AMjs
const rows = await supabaseClient.from('profiles').select('*');
The select works fine, but I want it to impersonate the user so it would only return that person's profile, using Supabase policies.
I have the JWT (access_token) of the user but I can't find a way to create the client so the policies would act. I always end up getting all the rows.
Can someone help me with that?
Thank you very much!
PS: Here's the table and policies definition:
sql
create table public.profiles (
id uuid references auth.users(id) not null ,
first_name text,
last_name text,
primary key (id)
);
alter table public.profiles enable row level security;
create policy "Users can get own profile."
on profiles for select
using ( auth.uid() = id );
Pure
12/17/2022, 12:29 PMglowcap
12/17/2022, 5:03 PM.Token
value in the email template.
The docs say to replace .ConfirmationURL
with the token value, but it's still embedded in an href which obviously isn't ideal. Can someone instruct me on how to just display the Token value?navandstokes
12/17/2022, 6:52 PMJaaneek
12/18/2022, 1:07 AMfloyare
12/18/2022, 3:28 PMuser1
have row that targets user2
and user1 can't insert any more of this combination. And now my question is is it possible to do it with RLS?Torwent
12/18/2022, 6:15 PMjavascript v2.0
release and no matter what I try data.session
from supabase.auth.getSession()
is always null
.
To be specific, I'm using "@supabase/supabase-js": "^2.2.1"
.
This is the code I'm trying to run:
typescript
const options = { auth: { autoRefreshToken: true, persistSession: true } }
const supabase = createClient(env.SB_URL, env.SB_ANON_KEY, options)
const login = async () => {
const { data, error } = await supabase.auth.getSession()
if (error) {
console.error(error)
return false
}
if (data.session == null) {
console.log("here")
const { data, error } = await supabase.auth.signInWithPassword({
email: env.USER,
password: env.PASS,
})
if (error) {
console.error(error)
return false
}
//I've printed data here, All seems fine.
}
//debugging here my session:
console.log(await supabase.auth.getSession())
return true
}
I've also tried using supabase.getUser()
but the result is the same, it's always null
.
What am I doing wrong? :Sitisnajim
12/18/2022, 11:01 PMdocker-compose up -d
supabase-auth
and supabase-storage
won't to start, other services are ok !
console
supabase-storage | 2022 Error: getaddrinfo EAI_AGAIN supabase_storage_admin
supabase-storage | 2022 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
supabase-storage | 2022 errno: -3001,
supabase-storage | 2022 code: 'EAI_AGAIN',
supabase-storage | 2022 syscall: 'getaddrinfo',
supabase-storage | 2022 hostname: 'supabase_storage_admin'
any idea of how to fix?Xepp
12/18/2022, 11:02 PMconst { uploadData, uploadError } = await supabase.storage
.from(bucketName)
.upload(fileName, file, { upsert: true });
if (uploadError) {
setError("Upload error: " + uploadError.message);
return;
}
let { publicURL, error } = await supabase.storage
.from(bucketName)
.getPublicUrl(fileName);
// publicUrl is undefined
`
How can I achieve this?Matt B
12/19/2022, 12:32 AMhyperknot
12/19/2022, 2:23 AMjarryd
12/19/2022, 6:01 AMLukas?
12/19/2022, 7:59 AMAliCodes!
12/19/2022, 9:03 AMtalpiven
12/19/2022, 10:13 AM