Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSR Auth Problem #5

Open
apolo-damasco opened this issue Dec 13, 2023 · 0 comments
Open

SSR Auth Problem #5

apolo-damasco opened this issue Dec 13, 2023 · 0 comments

Comments

@apolo-damasco
Copy link

apolo-damasco commented Dec 13, 2023

Since the supabase-auth-helpers package is being deprecated I implemented the SSR auth in pretty much the same way you implemented auth-helpers it in the latest version of this codebase.

My problem is that with RLS active I am getting no invoices. Looking at the logs it seems that the functions running in invoiceStore.ts are not authentificated and therefore not being able to bypass RLS. It makes sense to me because invoiceStore.ts is using the client created in supabase.ts that is using the anonkey and not the session of the user. But then how can you make it work in your version?

I have got it working creating an instance of supabase from locals in the +page.ts of a route but then I don't get the store and I don't get the unified methods for working with the database in a single file.

https://supabase.com/docs/guides/auth/auth-helpers/sveltekit?language=ts#server-side-data-fetching-with-rls

Could you help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant