How do I get custom auth hook to execute in the local development environment #22600
Replies: 6 comments 4 replies
|
@LMarshallAfzal Not sure if you got this working yet, but my suggestion would be to ensure that you have that postgres function for your custom access token hook locally. e.g. |
|
Have you managed to solve this problem? I faced the same problem. Supabase was launched in a self-host variant. I have a feeling that with self-host, the config.toml file is not readable at all. After all, everything is downloaded from the docker hub, and there are no volumes that would give access to this file. |
|
In case anyone else comes across this forum's question first while searching the web for an answer ... The supabase documentation covers this https://supabase.com/docs/guides/auth/auth-hooks#local-development, with some extra information in this issue #22031. Basically edit your where
Tested with supabase-cli v1.165.0 on Apple M2 Pro running Docker Desktop. |
|
Probably not the case for most people but hopefully helps someone, please double check your auth hook and edge function name. If you blindly follow the docs you could end up using |
|
I'm still having issue to get it running, having the user receive a confirmation email after signup
This is my config.toml: [functions.auth-hook-emails] The endpoint is created as expected when I run supabase functions serve.-: However, when checking at the docker logs I get the following: Which configuration am I supposed to implement? |
|
I have similar problem. I am able to get the user_role when calling That's why RBAC works in production but not in local development setup. I guess the only option left is to modify authorize() function to not rely on claims fetched from auth.jwt() but directly fetch claims from user_role table 🤷♂️ Please let me know if you have any better idea on how to fix this problem. |
Uh oh!
There was an error while loading. Please reload this page.
I am working on an app with Supabase and Svelte and currently working on Role Based Access Control. I used the guide in the Supabase docs to implement it. (https://supabase.com/docs/guides/auth/custom-claims-and-role-based-access-control-rbac).
I managed to get it working on the remote supabase project, but not on the local development environment. I have configured the hook to the
config.tomlhere:But the hook is not executing, Is there anything I have missed when working in the local development environment that I need to set up for this to work, because RBAC is really important in this project and if I cannot get it to work in the local development environment I will need to switch to a different tech stack away from supabase. I am using supabase CLI version 1.153.4.
All reactions