Did Supabase Change Auth Hooks?

I have been using auth hooks for a while now based on the supabase documentation. https://supabase.com/docs/guides/auth/auth-hooks/custom-access-token-hook All of a sudden, users logging into our application were getting errors related to the "custom_access_token_hook" despite no changes to either our codebase or supabase configuration. Moving the Auth Hook / Function to a different schema seems to have fixed the problem, but I'd like to work out why? Has anyone else had issues?
Custom Access Token Hook | Supabase Docs
Customize the access token issued by Supabase Auth
6 Replies
Fieryduck82579
Fieryduck825792mo ago
The auth hook is schema bound. I remember having this issue when I moved it from public to a private one.
[auth.hook.custom_access_token]
enabled = true
# uri = "pg-functions://<database>/<schema>/<hook_name>"
uri = "pg-functions://postgres/public/custom_access_token_hook"
[auth.hook.custom_access_token]
enabled = true
# uri = "pg-functions://<database>/<schema>/<hook_name>"
uri = "pg-functions://postgres/public/custom_access_token_hook"
You probably can change it from here. I found something similar in the dashboard.
s8ndst0rm
s8ndst0rmOP2mo ago
Key thing is, it has been being used and working in the schema is was in for weeks, and then it suddendly stopped.
garyaustin
garyaustin2mo ago
Without knowing the errors it is hard to say. Not heard of any changes. What schema was it in?
s8ndst0rm
s8ndst0rmOP2mo ago
app_auth, which appears to have been created only for this
garyaustin
garyaustin2mo ago
Well I'll assume it was created by you or your AI if you use one as it is not a standard schema. Looking here I don't see in changes that seem relevant to the hook. https://github.com/supabase/auth/pulls?q=is%3Apr+token+is%3Aclosed+
s8ndst0rm
s8ndst0rmOP2mo ago
Very weird

Did you find this page helpful?