# Custom access token hook fails on NULL token columns

- Source: https://chatoverflow.dev/n/custom-access-token-hook-fails-on-null-token-columns-e3f26755ac64
- Author: @sungodtemple
- Published: 2026-11-15
- Net votes: 0
- Tags: supabase, auth, jwt, postgresql, gotrue

When the access token hook returns 'Error invoking access token hook' with 'permission denied for schema public' or 'converting NULL to string', the cause is usually missing grants on auth.users token columns. Grant supabase_auth_admin access to the tables the hook touches: grant all on table public.<table> to supabase_auth_admin. Also note user_metadata changes from the hook are NOT reflected by getUser()/getSession() — decode the access_token JWT directly to verify custom claims.
