From f591c2b0a0ccf6c46db23d83564294a544ad5905 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sat, 28 Mar 2026 23:20:25 +0100 Subject: [PATCH] =?UTF-8?q?Remove=20loopback=20redirect=20URIs=20=E2=80=94?= =?UTF-8?q?=20web=20apps=20can't=20use=20them=20per=20ATProto=20spec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OAuth only works on coffee.apoena.dev. Local dev is for UI only. Co-Authored-By: Claude Sonnet 4.6 --- public/client-metadata.json | 4 +--- src/lib/atproto.ts | 5 ++--- vite.config.ts | 3 --- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/public/client-metadata.json b/public/client-metadata.json index c69a1eb..85a10b6 100644 --- a/public/client-metadata.json +++ b/public/client-metadata.json @@ -3,9 +3,7 @@ "client_name": "Coffee Map", "client_uri": "https://coffee.apoena.dev", "redirect_uris": [ - "https://coffee.apoena.dev/oauth/callback", - "http://127.0.0.1:5173/oauth/callback", - "http://127.0.0.1:5174/oauth/callback" + "https://coffee.apoena.dev/oauth/callback" ], "grant_types": ["authorization_code", "refresh_token"], "response_types": ["code"], diff --git a/src/lib/atproto.ts b/src/lib/atproto.ts index c662c15..2606a70 100644 --- a/src/lib/atproto.ts +++ b/src/lib/atproto.ts @@ -5,9 +5,8 @@ import { Agent } from '@atproto/api' // so the PDS can fetch it — even in local dev. const PROD_URL = 'https://coffee.apoena.dev' -// redirect_uri is dynamic so local dev redirects back to the right origin. -// RFC 8252 forbids "localhost" — replace with 127.0.0.1 for loopback. -const ORIGIN = window.location.origin.replace('localhost', '127.0.0.1') +// OAuth only works on the deployed domain (web apps can't use loopback). +const ORIGIN = PROD_URL let _client: BrowserOAuthClient | null = null diff --git a/vite.config.ts b/vite.config.ts index 87c5fde..f81d41d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,9 +5,6 @@ import UnoCSS from 'unocss/vite' import { fileURLToPath } from 'node:url' export default defineConfig({ - server: { - host: '127.0.0.1', - }, resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)),