Remove loopback redirect URIs — web apps can't use them per ATProto spec
OAuth only works on coffee.apoena.dev. Local dev is for UI only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,9 +3,7 @@
|
|||||||
"client_name": "Coffee Map",
|
"client_name": "Coffee Map",
|
||||||
"client_uri": "https://coffee.apoena.dev",
|
"client_uri": "https://coffee.apoena.dev",
|
||||||
"redirect_uris": [
|
"redirect_uris": [
|
||||||
"https://coffee.apoena.dev/oauth/callback",
|
"https://coffee.apoena.dev/oauth/callback"
|
||||||
"http://127.0.0.1:5173/oauth/callback",
|
|
||||||
"http://127.0.0.1:5174/oauth/callback"
|
|
||||||
],
|
],
|
||||||
"grant_types": ["authorization_code", "refresh_token"],
|
"grant_types": ["authorization_code", "refresh_token"],
|
||||||
"response_types": ["code"],
|
"response_types": ["code"],
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ import { Agent } from '@atproto/api'
|
|||||||
// so the PDS can fetch it — even in local dev.
|
// so the PDS can fetch it — even in local dev.
|
||||||
const PROD_URL = 'https://coffee.apoena.dev'
|
const PROD_URL = 'https://coffee.apoena.dev'
|
||||||
|
|
||||||
// redirect_uri is dynamic so local dev redirects back to the right origin.
|
// OAuth only works on the deployed domain (web apps can't use loopback).
|
||||||
// RFC 8252 forbids "localhost" — replace with 127.0.0.1 for loopback.
|
const ORIGIN = PROD_URL
|
||||||
const ORIGIN = window.location.origin.replace('localhost', '127.0.0.1')
|
|
||||||
|
|
||||||
let _client: BrowserOAuthClient | null = null
|
let _client: BrowserOAuthClient | null = null
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ import UnoCSS from 'unocss/vite'
|
|||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
server: {
|
|
||||||
host: '127.0.0.1',
|
|
||||||
},
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
||||||
|
|||||||
Reference in New Issue
Block a user