-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
permission denied for schema next_auth #7032
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
Comments
Im running into the same error. Were you able to find a solution or workaround for this issue? |
No, unfortunately not. |
any fix get found here? I am seeing the same thing |
same problem! any solution? |
I used service key instead of the anon key and the problem went away. |
Isn't that a huge security problem? That bypasses row level security. Anyone find a real solution to this? |
I didn't find a solution to this other than providing the service key. At the end the service key u provide is handled on the backend. |
@arscroggin It's a real solution.
Which means you should store it as an environment variable / secret in the backend. |
This comment has been minimized.
This comment has been minimized.
Had the same problem: turns out auth.uid() will produce the same output (at least for me it does) as next_auth.uid() and you can use this instead |
The solution to this IS to just use the SERVICE_ROLE_KEY Set it as a an env variable in your build env. It should NOT be visible to the client. They literally say this here: https://authjs.dev/getting-started/adapters/supabase?_gl=1*fbem8r*_gcl_au*MTI0MDg0MTkzNi4xNzQ0OTc0MzM2LjMwMTQ5NzMyNi4xNzQ0OTg4Mzk1LjE3NDQ5ODgzOTQ. ![]() |
Why is this not closed? this is ancient and solved |
Adapter type
@next-auth/supabase-adapter
Environment
System:
OS: Linux 5.19 Ubuntu 22.10 22.10 (Kinetic Kudu)
Container: Yes
Shell: 5.2.2 - /bin/bash
Binaries:
Node: 19.8.1 - /usr/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 9.5.1 - /usr/bin/npm
npmPackages:
@next-auth/supabase-adapter: ^0.2.1 => 0.2.1
"next-auth": "^4.20.1",
Reproduction URL
https://github.com/nextauthjs/next-auth-example
Describe the issue
Permission denied to access supabase next_auth schema after following documentation.
How to reproduce
I followed the instructions on https://next-auth.js.org/adapters/supabase setting up a project on supabase, using the
NextAuth Schema Setup
in the SQLEditor and added thenext_auth
schema in the API config as exposed schema.When I run the project with
npm run dev
, however, I got an error from in the consoleI explored the issue and found that if I set the schema permission to anon in supabase
I get another error, now only for the session table.
Expected behavior
I don't know if anything changed in supabase with their roles, but I think this should work out-of-the box with the given templates, and not require to grant public
anon
access to the schema and tables.The text was updated successfully, but these errors were encountered: