Fix CORS proxy for APK Builder API key requests

Use Shakespeare's built-in corsProxy config and proxyUrl function
instead of hardcoded corsproxy.io which had an incorrect URL format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
Derek RossandClaude Opus 4.5 committed 2026-01-04 00:34:12 -05:00
1 parent fb6d2cac82
commit 4c56e37212
2 files changed
+5 -2

No files matched your search

+3 -1
View File
@@ -20,6 +20,7 @@ import {
import { ExternalFavicon } from '@/components/ExternalFavicon';
import { Link } from 'react-router-dom';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useAppContext } from '@/hooks/useAppContext';
import { requestBuildServerApiKey } from '@/lib/nip98';
interface PresetProvider {
@@ -89,6 +90,7 @@ export function AddProviderDialog({
}: AddProviderDialogProps) {
const { t } = useTranslation();
const { user } = useCurrentUser();
const { config } = useAppContext();
const [apiKey, setApiKey] = useState('');
const [accountId, setAccountId] = useState('');
const [organizationId, setOrganizationId] = useState('');
@@ -124,7 +126,7 @@ export function AddProviderDialog({
const result = await requestBuildServerApiKey(
user.signer,
buildServerUrl.trim(),
preset.proxy ? 'https://corsproxy.io/?' : undefined
preset.proxy ? config.corsProxy : undefined
);
setApiKey(result.apiKey);
} catch (error) {
+2 -1
View File
@@ -3,6 +3,7 @@
* Creates signed events for HTTP authentication
*/
import type { NostrSigner, NostrEvent } from '@nostrify/nostrify';
import { proxyUrl } from './proxyUrl';
/**
* Create a NIP-98 auth event for HTTP requests
@@ -86,7 +87,7 @@ export async function requestBuildServerApiKey(
// Make the request (use CORS proxy if provided)
const targetUrl = corsProxy
? `${corsProxy}/${authUrl.replace(/^https?:\/\//, '')}`
? proxyUrl(corsProxy, authUrl)
: authUrl;
const response = await fetch(targetUrl, {