Commit Graph

19 Commits

Author SHA1 Message Date
Alaister Young
5f533247e1 Update docs url to env var (#38772)
* Update Supabase docs URLs to use env variable

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for documentation links

This change centralizes documentation links using a new DOCS_URL constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for all documentation links

This change replaces hardcoded documentation URLs with a centralized constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* replace more instances

* ci: Autofix updates from GitHub workflow

* remaining instances

* fix duplicate useRouter

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: alaister <10985857+alaister@users.noreply.github.com>
2025-09-26 10:16:33 +00:00
Joshen Lim
cab0585533 Fe 1799/consolidate to useselectedprojectquery and (#37684)
* Replace all usage of useProjectContext with useSelectedProjectQuery

* Replace all usage of useSelectedProject with useSelectedProjectQuery

* Replace all usage of useProjectByRef with useProjectByRefQuery

* Replace all usage of useSelectedOrganization with useSelectedOrganizationQuery

* Deprecate useSelectedProject, useSelectedOrganization, and useProjectByRef hooks

* Deprecate ProjecContext
2025-08-06 10:53:10 +07:00
Chris 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
Jordi Enric
792e2316f0 fix schema selector in create fn sheet (#36141)
* fix schema selector in create fn sheet

* fix schemaselctor in auth hook

* add portal false to schemaselector in sqlfunction for cronjobs

* Fix schema selector in function sheet

---------

Co-authored-by: Terry Sutton <saltcod@gmail.com>
2025-06-03 09:26:13 -02:30
Peter
e8f4273499 fix default enable state for auth hooks to be true (#35942) 2025-05-26 15:23:29 -05:00
Marc Köhler
724f046170 fix(studio): auth email hook sheet padding (#32569) 2025-01-09 11:47:14 +00:00
Joshen Lim
fdf4dec344 Chore/cleanup feature flags 041224 (#30885)
* Deprecate enableFreeSupport flag

* Deprecate enableExperimentalTheme flag and ThemeSettingsOld component

* Deprecate httpsAuthHooksEnabled flag

* Deprecate thirdPartyAuth flag

* Deprecate logdrains flag

* Deprecate enableNewRegions flag

* Deprecate cronUi flag

* Deprecate queues flag and old ProjectIntegrationsLayout folder
2024-12-04 17:04:53 +08:00
Joshen Lim
d47048dcd6 Update auth hooks to allow selection of fns that return void (#30022)
* Update auth hooks to allow selection of fns that return void

* Update for only send email hook
2024-10-22 20:49:20 +08:00
Joshen Lim
34f02f344b Revert "Revert "Update auth hooks to use new endpoint and add perms checking"" (#29894)
Revert "Revert "Update auth hooks to use new endpoint and add perms checking"…"

This reverts commit a2a94d1f74.
2024-10-16 09:13:07 +08:00
Joshen Lim
a2a94d1f74 Revert "Update auth hooks to use new endpoint and add perms checking" (#29893)
Revert "Update auth hooks to use new endpoint and add perms checking (#29870)"

This reverts commit a3e1fb2a0e.
2024-10-15 07:51:23 +00:00
Joshen Lim
a3e1fb2a0e Update auth hooks to use new endpoint and add perms checking (#29870)
* Update auth hooks to use new endpoint and add perms checking

* Remove unnecessary import

* Update perms checking for edge functions secrets
2024-10-15 15:20:34 +08:00
Terry Sutton
692e363bc3 Chore/fix hooks sheet (#29746)
* Fix auth hooks scrolling

* Padding

* Use sheet section

* Use sheet section, again

* Fix minor details.

* The sheet section should have px-5 to match the header and footer.

* Remove all custom px on elements in the create hook sheet.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-10-08 16:20:59 +00:00
Ivan Vasilov
fd3309c886 feat: UI for pg-cron (#29291)
* Add crons option in the database menu.

* Add react-hook-form to the studio package.json.

* Refactor the functionSelector to be used by other features.

* Add the bulk of the functionality for the cron UI. Some of the code is copy-pasted from functions feature, needs to be cleaned before merging.

* Tons of changes, the Create Cron sheet works now.

* Added some more functionality for the cronjob feature.

* Convert the Cron table to a listing with cards.

* Add click-to-copy in the Auth Hooks feature.

* Remove extra prop.

* Fix type errors.

* Fix some random issues. Fix the tests.

* Fix the tests.

* Add a style for disabled radio button item.

* Make the default SQL snippet. Handle the case pg_net is not installed.

* Fix the heading and save button when creating a new cron job.

* Change the name of the custom label in the schedule dropdown.

* Minor fixes.

* Rename all mentions of cronjobs to cron jobs.

* Always show the cron jobs link.

* Rename the link from crons to cron-jobs.

* Fix the disabled state for the stacked radio group.

* More minor fixes.

* More small fixes.

* Fix the tests.

* Minor UI tweaks

* More minor tweaks

* Add padding bottom

* Add feature flag for the cron ui.

* Fix the SQL function option.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-10-03 15:11:17 -02:30
Ivan Vasilov
df52ea7ee0 feat: Replace all toasts with sonner (#28250)
* Update the design of the sonner toasts. Add the close button by default.

* Migrate studio and www apps to use the SonnerToaster.

* Migrate all toasts from studio.

* Migrate all leftover toasts in studio.

* Add a new toast component with progress. Use it in studio.

* Migrate the design-system app.

* Refactor the consent toast to use sonner.

* Switch docs to use the new sonner toasts.

* Remove toast examples from the design-system app.

* Remove all toast-related components and old code.

* Fix the progress bar in the toast progress component. Also make the bottom components vertically centered.

* Fix the width of the toast progress.

* Use text-foreground-lighter instead of muted for ToastProgress text

* Rename ToastProgress to SonnerProgress.

* Shorten the text in sonner progress.

* Use the correct classes for the close button. Add a const var for the default toast duration. Remove the custom width class from sonner.

* Set the position for all progress toasts to bottom right. Set the duration for all toasts to the default (when reusing a toast id from loading/progress toast, the duration is set to infinity).

* Fix the playwright tests.

* Refactor imports to use ui instead of @ui.

* Change all imports of react-hot-toast with sonner. These components were merged since the last commit to this branch.

* Remove react-hot-toast lib.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-08-31 07:50:51 +08:00
Kang Ming
485d85fb9b fix: disable sms provider validation when sms hook is enabled (#28706)
* fix: disable sms provider validation when sms hook is enabled

* chore: add comments

* Small fixes

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-08-19 11:06:36 -04:00
Kang Ming
d65562d1d4 fix: apply grants on create / update / delete auth postgres hook (#28609)
* fix: apply grants on create / update / delete auth postgres hook

* fix: move executeSql into onSuccess callback

* fix: use useMemo to get permission changes

* fix: standardize padding

* fix: increase size of delete modal

* Minor fixes for the useMemo and the divs for the code editor.

* chore: resolve comment

* Reorder the code.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2024-08-15 10:55:58 -04:00
Ivan Vasilov
b73317fc67 feat: Pricing for TPA (#28454)
* Don't set fixed height on the generateSecret button in hooks sheet.

* Block two of the TPA providers on free plan orgs.

* Fix some copy. Add more explanation about the pricing.

* Update copy

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2024-08-14 11:01:58 +02:00
Alaister Young
70da0f1d1d chore: cleanup packages (#27770)
* chore: cleanup packages

- Avoid circular imports
- Export API-types as types
- pg-format without depending on Node internal Buffer (not browser-compatible)
- Avoid importing from barrel files in ui dir

* chore: avoid barrel file imports in studio (#27771)

* chore: avoid barrel file imports

- Removes some unused imports
- Avoids barrel file import for faster builds + less memory

* add eslint rule

* type fixes

* delete layouts barrel

* delete components/grid barrel file

* delete components/grid/utils barrel file

* delete components/grid/components/common barrel file

* delete components/grid/components/editor barrel file

* delete components/grid/components/formatter barrel file

* delete components/grid/components/grid barrel file

* delete components/grid/components/header/filter barrel file

* remote components/grid/store barrel file

* remove components/interfaces/Auth/Policies barrel file

* delete components/interfaces/Settings/Logs barrel file

* delete components/ui/CodeEditor barrel file

* delete components/ui/Forms barrel file

* delete components/ui/Shimmers barrel file

* delete data/analytics barrel file

* delete hooks barrel file

* cleanup lib/common/fetch barrel file

* final * barral files cleanup

* global react-data-grid styles

* remove console.log

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>

* fix build

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2024-07-04 14:48:10 +08:00
Joel Lee
35645efc6f feat: add UI For Auth HTTP Hooks (#22495)
* feat: add https auth hook support

* fix: commit changes

* fix: add enterprise hook config

* fix: add descriptionText

* Revert the changes to the ui components.

* Refactor the whole hooks page into a table with adding/editing hook in a side panel.

* Dele	te unused file.

* Rename all web strings to HTTPS.

* Put all fields in the hook card in a copyable and revealable input.

* Start nudges

* Nudges

* Add validation for both types of hooks.

* Reorganize the layouts for the both types of hooks.

* Move the button for enabling a hook in the side panel.

* Move the button for deleting a hook in the side panel.

* Minor redesign of the hook card.

* Add a link to upgrade to enterprise.

* Fix type errors.

* Simplify function selector.

* Add checked prop to the toggle.

* Wait when deleting a hook.

* Use the new RadioGroup.

* Add a flag for https hooks.

* Minor CSS fixes.

* Change the page to use scaffold containers.

* Minor fixes.

* Convert the description to markdown. Fix. the generate secret onClick handler.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
2024-05-29 10:31:29 +02:00