docs: update stale auth hook links (#46948)

This updates the remaining stale auth hook references after the auth
hooks guide moved from hash anchors to dedicated subpages.

It switches the RBAC guide to the current custom access token hook page,
updates the MFA verification hook reference in both the docs error-code
source and the shared-data export, and fixes the matching custom access
token hook comments in the Slack Clone SQL examples.

Testing: not run. Link-target updates only.

Refs #46947


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Documentation**
* Updated error code and auth hook documentation reference links to
point to more specific canonical documentation pages, improving accuracy
of references for developers.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Peter Chen J. authored and GitHub committed 2026-06-18 12:09:29 +00:00
1 parent ba00a311db
commit 4a57a95755
7 files changed
+8 -10

No files matched your search

@@ -126,7 +126,7 @@ description = "MFA challenge could not be verified -- wrong TOTP code."
[mfa_verification_rejected]
description = "Further MFA verification is rejected. Only returned if the MFA verification attempt hook returns a reject decision."
[[mfa_verification_rejected.references]]
href = "https://supabase.com/docs/guides/auth/auth-hooks?language=add-admin-role#hook-mfa-verification-attempt"
href = "https://supabase.com/docs/guides/auth/auth-hooks/mfa-verification-hook"
description = "MFA verification hook"
[mfa_verified_factor_exists]
@@ -18,7 +18,7 @@ Custom Claims are special attributes attached to a user that you can use to cont
}
```
To implement Role-Based Access Control (RBAC) with `custom claims`, use a [Custom Access Token Auth Hook](/docs/guides/auth/auth-hooks#hook-custom-access-token). This hook runs before a token is issued. You can use it to add additional claims to the user's JWT.
To implement Role-Based Access Control (RBAC) with `custom claims`, use a [Custom Access Token Auth Hook](/docs/guides/auth/auth-hooks/custom-access-token-hook). This hook runs before a token is issued. You can use it to add additional claims to the user's JWT.
This guide uses the [Slack Clone example](https://github.com/supabase/supabase/tree/master/examples/slack-clone/nextjs-slack-clone) to demonstrate how to add a `user_role` claim and use it in your [Row Level Security (RLS) policies](/docs/guides/database/postgres/row-level-security).
@@ -71,7 +71,7 @@ values
## Create Auth Hook to apply user role
The [Custom Access Token Auth Hook](/docs/guides/auth/auth-hooks#hook-custom-access-token) runs before a token is issued. You can use it to edit the JWT.
The [Custom Access Token Auth Hook](/docs/guides/auth/auth-hooks/custom-access-token-hook) runs before a token is issued. You can use it to edit the JWT.
<Tabs
scrollable
@@ -145,7 +145,7 @@ alter publication supabase_realtime add table public.users;
*/
-- Create the auth hook function
-- https://supabase.com/docs/guides/auth/auth-hooks#hook-custom-access-token
-- https://supabase.com/docs/guides/auth/auth-hooks/custom-access-token-hook
create or replace function public.custom_access_token_hook(event jsonb)
returns jsonb
language plpgsql
@@ -221,4 +221,3 @@ begin
return user_id;
end;
$$ language plpgsql;
@@ -4,7 +4,7 @@
*/
-- Create the auth hook function
-- https://supabase.com/docs/guides/auth/auth-hooks#hook-custom-access-token
-- https://supabase.com/docs/guides/auth/auth-hooks/custom-access-token-hook
create or replace function public.custom_access_token_hook(event jsonb)
returns jsonb
language plpgsql
@@ -145,7 +145,7 @@ alter publication supabase_realtime add table public.users;
*/
-- Create the auth hook function
-- https://supabase.com/docs/guides/auth/auth-hooks#hook-custom-access-token
-- https://supabase.com/docs/guides/auth/auth-hooks/custom-access-token-hook
create or replace function public.custom_access_token_hook(event jsonb)
returns jsonb
language plpgsql
@@ -221,4 +221,3 @@ begin
return user_id;
end;
$$ language plpgsql;
@@ -4,7 +4,7 @@
*/
-- Create the auth hook function
-- https://supabase.com/docs/guides/auth/auth-hooks#hook-custom-access-token
-- https://supabase.com/docs/guides/auth/auth-hooks/custom-access-token-hook
create or replace function public.custom_access_token_hook(event jsonb)
returns jsonb
language plpgsql
+1 -1
View File
@@ -177,7 +177,7 @@ export const ERROR_CODES: Record<ErrorCodeService, Record<string, ErrorCodeDefin
'Further MFA verification is rejected. Only returned if the MFA verification attempt hook returns a reject decision.',
references: [
{
href: 'https://supabase.com/docs/guides/auth/auth-hooks?language=add-admin-role#hook-mfa-verification-attempt',
href: 'https://supabase.com/docs/guides/auth/auth-hooks/mfa-verification-hook',
description: 'MFA verification hook',
},
],