A full-featured CRM built with React, shadcn/ui, and Supabase.
Use the hash route as OAuth authorization path and document OAuth setup
fzaninottoc8b58e60dcbe
diff --git a/doc/src/content/docs/developers/supabase-configuration.mdx b/doc/src/content/docs/developers/supabase-configuration.mdxindex 90f9b9a0..c8505034 100644--- a/doc/src/content/docs/developers/supabase-configuration.mdx+++ b/doc/src/content/docs/developers/supabase-configuration.mdx@@ -172,11 +172,19 @@ When using a remote Supabase instance, you need to configure the callback URL asIf you host Atomic CRM under the `https://example.com/atomic-crm/` URL, the callback URL should be `https://example.com/atomic-crm/auth-callback.html`.-## Setting The OAuth Consent Page+## Enabling The OAuth ServerThe [MCP server](../../users/mcp-server) authenticates AI assistants with the Supabase OAuth 2.1 server, which redirects users to a consent page hosted by the frontend. With a local Supabase instance, this is already configured in `supabase/config.toml`.-With a remote Supabase instance, go to **Authentication** > **OAuth Server** in the project dashboard and set the **Authorization Path** to `/oauth-consent.html`. This static page forwards to the in-app consent route, as the app uses hash-based routing.+The OAuth server is disabled by default on remote Supabase instances. To enable it:++1. Go to the project dashboard at [supabase.com](https://supabase.com/).+2. Go to **Authentication** > **OAuth Server**.+3. Enable the OAuth server.+4. Set the **Authorization Path** to `/#/oauth/consent` (the default `/oauth/consent` doesn't work, as Atomic CRM uses hash-based routing).+5. Enable **Dynamic Client Registration**, so that AI assistants can register themselves.++The consent page is served relative to the **Site URL** (see [Setting The Login Callback](#setting-the-login-callback)).## Customizing Email Templatesdiff --git a/doc/src/content/docs/users/mcp-server.mdx b/doc/src/content/docs/users/mcp-server.mdxindex a3e2fe49..a39f0532 100644--- a/doc/src/content/docs/users/mcp-server.mdx+++ b/doc/src/content/docs/users/mcp-server.mdx@@ -7,7 +7,7 @@ You can interact with the data stored in your Atomic CRM instance using an AI as-The Atomic CRM MCP server is powered by Supabase Edge Functions and Supabase OAuth, and requires no installation.+The Atomic CRM MCP server is powered by Supabase Edge Functions and Supabase OAuth, and requires no installation. Your administrator must first enable the OAuth server on the Supabase instance (see [Enabling The OAuth Server](../../developers/supabase-configuration#enabling-the-oauth-server)).## Getting The MCP Server URLdiff --git a/public/oauth-consent.html b/public/oauth-consent.htmldeleted file mode 100644index 8f4cbdc0..00000000--- a/public/oauth-consent.html+++ /dev/null@@ -1,17 +0,0 @@-<!doctype html>-<html lang="en">- <head>- <meta charset="utf-8" />- <title>Atomic CRM</title>- </head>- <body>- <script>- // Supabase Auth redirects OAuth consent requests to a plain path, but- // the app uses hash routing: forward to the consent route, keeping- // the authorization_id query parameter.- window.location.replace(- `./#/oauth/consent${window.location.search}`- );- </script>- </body>-</html>diff --git a/supabase/config.toml b/supabase/config.tomlindex 4ddfd286..81b76105 100644--- a/supabase/config.toml+++ b/supabase/config.toml@@ -86,7 +86,7 @@ signing_keys_path = "./signing_keys.json"[auth.oauth_server]enabled = true-authorization_url_path = "/oauth-consent.html"+authorization_url_path = "/#/oauth/consent"allow_dynamic_registration = true[auth.email]