Commit Graph
21 Commits
Author SHA1 Message Date
Chris StocktonandChris Stockton 97a447ac5c docs(auth-hooks): clarify webhook status codes and document email_change quirk (#38141)
* docs(auth-hooks): clarify webhook status codes and document email_change quirk

- Clarify hook response handling:
  - Note that some hooks do not support 204 responses if they require a body
  - Update retry-able error behavior for 429/503 with explicit 5s budget
  - Add note that Retry-After header is only checked for non-empty value, not parsed

- Expand send-email-hook docs:
  - Add detailed section on `email_change` behavior
  - Explain secure vs non-secure modes and when two emails must be sent
  - Document long-standing quirk where `token_hash` and `token_hash_new`
    are swapped relative to expected naming
  - Extend enum to include `reauthentication`
  - Improve confirmation URL example using URLSearchParams and projectRef

* fix: fix linter error

* fix: pr feedback

* fix: pnpm format

* fix: pr feedback

---------

Co-authored-by: Chris Stockton <chris.stockton@supabase.io>
2025-08-26 08:41:13 -07:00
Chris StocktonandChris Stockton 8a4bca34a7 feat: add documentation and UI integration for Before User Created hook (#36567)
* feat: add documentation and UI integration for Before User Created hook

- Added new guide: `before-user-created-hook.mdx`, documenting usage, inputs,
  outputs, and multiple complete examples for HTTP and SQL.
- Updated navigation menu and hook index table to include the new hook.
- Hook is now listed as available on Free and Pro plans.

Studio changes:
- Registered `Before User Created` hook in `hooks.constants.ts` with proper
  title, slug, and configuration keys.
- Enabled Docs button linking to hook guide in both `CreateHookSheet` and `HookCard` components.
- Extended hook listing page to support docs access via `secondaryActions`.

This hook allows developers to intercept and reject user creation across all
flows (email/password, OAuth, SSO, SAML, anonymous) - enabling custom signup
logic like domain allowlists, geofencing, or account gating.

* fix: add subnet to mdx lint allowed list

* fix: incorporate feedback and spelling changes

* feat: add allow/deny domain and CIDR examples to before-user-created hook

This commit enhances the documentation for the before-user-created auth hook:
- Adds production-ready SQL examples for blocking or allowing signups by email domain (signup_email_domains) and IP address or CIDR (signup_networks)
- Introduces enum-based classification (allow vs deny) for both domain and network restrictions
- Adds full migration-style snippets for easy copy/paste into Supabase SQL Editor
- Includes updated HTTP examples that delegate to Postgres functions via Supabase client rpc()
- Adds environment setup guidance and edge function scaffolding

* fix: pnpm format

---------

Co-authored-by: Chris Stockton <chris.stockton@supabase.io>
2025-07-02 14:54:07 -07:00
Charis 6fcb98d927 docs(pg17): add docs on pg17 upgrades (#35431) 2025-05-22 14:07:06 -04:00
Charis a820c56ed0 chore: docs linting (#33574) 2025-02-21 14:13:00 -05:00
Florian Lefebvre 508420a9c4 docs(auth): improve auth hooks (#28936) 2025-02-19 06:00:27 +00:00
Han Qiao 6c24be3703 chore: clarify local hook secrets should be stripped of prefix (#33581) 2025-02-13 16:01:16 +00:00
Charis 2d55512553 chore: activate spelling and admonitions lints for docs (#33292) 2025-02-04 13:18:31 -05:00
Joel Lee aac7ae8279 fix: update role recommendations for Postgres Hooks (#31323)
* fix: update role recommendations for Postgres Hooks

* fix: add newline between description

* fix: run npm format
2025-01-03 09:46:47 +02:00
Charis 572111224b ci(docs): bump linter + expand linting to auth section (#30704) 2024-11-28 10:26:00 -05:00
Enyosolutions 9cdabe188e Doc: update documentation for secret name. (#30370) 2024-11-08 16:50:11 +00:00
Joel Lee f58afe2e76 fix: update to make explicit that there can be multiple secrets (#29553) 2024-10-01 07:28:42 +00:00
Kang Ming d18bef8b9c docs: update postgres hooks security model (#28681)
* fix: update security model for postgres hooks

* chore: remove grants from postgres hook examples
2024-08-15 16:13:14 -04:00
Joel Lee 39afdb3baf fix: update auth hooks docs to cater for new folder structure (#28621)
* fix: minor change to url

* fix: append -hook suffic

* fix: run prettier

* fix: update docs

* fix: run prettier again
2024-08-14 08:02:35 +00:00
a8f6b74dd3 docs: add http auth hook docs (#25880)
* feat: add http auth hook docs

* fix: add more notes

* fix: add send sms and send email stubs

* fix: add jsonschemas

* fix: add jsonschema for tab

* fix: restructure docs

* feat: add more http examples

* fix: add more examples

* feat: add sql hooks

* fix: patch vale errors

* fix: remove more uses of we

* fix: correct label

* fix: apply suggestions

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* fix: move to shared config

* fix: update mfa and password examples

* fix: add line about jsonschema

* fix: remove HTTP examples for MFA Verification and Password Verification

* chore: update hook secret description

* chore: cleanup overview and add subtitle

* chore: reorganize examples into tabs

* chore: reorganize sections

* chore: format input / outputs into tables

* chore: move each hook into separate pages

* chore: cleanup content

* chore: fix more formatting

* chore: add hooks to sidenav

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
2024-08-12 18:29:27 -07:00
Wen Bo XieandKevin Grüneberg f1541878a9 fix: singularize and capitalize Supabase plans (#28052)
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-07-18 04:49:00 +00:00
Richard Kavanagh 9dd25cd377 Update auth-hooks.mdx (#27785)
minor typos
2024-07-04 16:55:51 +00:00
Joel Lee 7547c52e4f fix: revoke role on public for hooks (#27077)
* fix: revoke role on public for hooks

* fix: update SQL editor queries

* fix: update examples

* fix: update RBAC doc

* fix: update description to describe why we revoke public

* fix: correct use of we

* fix: run prettier

* fix: remove unintentionally added files
2024-06-07 22:03:12 +02:00
Thor 雷神 SchaeffandCharis 7ce6958030 feat: add rbac claim auth hook. (#21263)
* feat: add rbac claim auth hook.

* feat: get user role from jwt.

* chore: update full-schema.

* feat: add RBAC guide.

* feat: use plpgsql.

* Apply suggestions from code review

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* chore: make top level claim.

* chore: set search_paths.

* chore: accessing custom claims.

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-03-04 14:24:32 +00:00
Joel LeeandCharis 99a60bdd3c docs: update auth hooks with grants (#21278)
* docs: update auth hooks with grants

* Update apps/docs/content/guides/auth/auth-hooks.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-02-16 10:24:25 +08:00
4e5d2cb187 docs: add local development section to auth hooks (#21122)
* docs: add local development section to auth hooks

* Update apps/docs/content/guides/auth/auth-hooks.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

---------

Co-authored-by: joel <joel@joels-MacBook-Pro.local>
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-02-09 10:07:14 +08:00
Charis e20038e2f2 refactor: move auth guides into content directory (#20777)
Begin the process of moving our MDX files into their own content directory.

Fixed a few minor bugs re: ToC and tabs not rerendering consistently on page navigation. (The ToC thing wasn't a problem before the refactor, the tabs thing is a problem on prod.)

Moved MDX files can't import their own components, so everything they require needs to be back in the component prop for mdx-remote's serializer. Cleaned this up a bit and lazy-loaded heavy/rare stuff. Also, the component prop doesn't take arbitrary objects (only actual components), so imported data has to be wrapped in a component.
2024-02-07 17:25:08 +00:00