mirror of
https://github.com/openclaw/clawhub.git
synced 2026-07-22 03:35:29 -04:00
fix: correct auth.clawdhub.com typo to auth.clawhub.com
Fixes #143 The issue reported CORS errors when uploading skills. The root cause was a typo in the legacy domain name - 'auth.clawdhub.com' (with an extra 'd') instead of 'auth.clawhub.com'. This typo appeared in: - src/lib/site.ts: LEGACY_CLAWDHUB_HOSTS set - packages/clawdhub/src/cli/registry.ts: LEGACY_REGISTRY_HOSTS set - Tests for both files When users tried to upload skills, requests were made to the non-existent 'auth.clawdhub.com' domain, causing CORS policy violations and 404s. Changes: - Fixed typo in site.ts legacy host set - Fixed typo in registry.ts legacy registry hosts - Removed duplicate 'auth.clawdhub.com' entry from registry.ts - Updated tests to reflect correct domain All tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,7 +37,7 @@ beforeEach(() => {
|
||||
|
||||
describe('registry resolution', () => {
|
||||
it('prefers explicit registry over discovery/cache', async () => {
|
||||
readGlobalConfig.mockResolvedValue({ registry: 'https://auth.clawdhub.com' })
|
||||
readGlobalConfig.mockResolvedValue({ registry: 'https://auth.clawhub.com' })
|
||||
discoverRegistryFromSite.mockResolvedValue({ apiBase: 'https://clawhub.ai' })
|
||||
|
||||
const registry = await resolveRegistry(
|
||||
@@ -49,7 +49,7 @@ describe('registry resolution', () => {
|
||||
})
|
||||
|
||||
it('ignores legacy registry and updates cache from discovery', async () => {
|
||||
readGlobalConfig.mockResolvedValue({ registry: 'https://auth.clawdhub.com', token: 'tkn' })
|
||||
readGlobalConfig.mockResolvedValue({ registry: 'https://auth.clawhub.com', token: 'tkn' })
|
||||
discoverRegistryFromSite.mockResolvedValue({ apiBase: 'https://clawhub.ai' })
|
||||
|
||||
const registry = await getRegistry(makeOpts(), { cache: true })
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { GlobalOpts } from './types.js'
|
||||
|
||||
export const DEFAULT_SITE = 'https://clawhub.ai'
|
||||
export const DEFAULT_REGISTRY = 'https://clawhub.ai'
|
||||
const LEGACY_REGISTRY_HOSTS = new Set(['auth.clawdhub.com', 'auth.clawhub.com', 'auth.clawhub.ai'])
|
||||
const LEGACY_REGISTRY_HOSTS = new Set(['auth.clawhub.com', 'auth.clawhub.ai'])
|
||||
|
||||
export async function resolveRegistry(opts: GlobalOpts) {
|
||||
const explicit = opts.registrySource !== 'default' ? opts.registry.trim() : ''
|
||||
|
||||
@@ -49,7 +49,7 @@ describe('site helpers', () => {
|
||||
withMetaEnv({ VITE_SITE_URL: 'https://clawdhub.com' }, () => {
|
||||
expect(getClawHubSiteUrl()).toBe('https://clawhub.ai')
|
||||
})
|
||||
withMetaEnv({ VITE_SITE_URL: 'https://auth.clawdhub.com' }, () => {
|
||||
withMetaEnv({ VITE_SITE_URL: 'https://auth.clawhub.com' }, () => {
|
||||
expect(getClawHubSiteUrl()).toBe('https://clawhub.ai')
|
||||
})
|
||||
})
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ export type SiteMode = 'skills' | 'souls'
|
||||
const DEFAULT_CLAWHUB_SITE_URL = 'https://clawhub.ai'
|
||||
const DEFAULT_ONLYCRABS_SITE_URL = 'https://onlycrabs.ai'
|
||||
const DEFAULT_ONLYCRABS_HOST = 'onlycrabs.ai'
|
||||
const LEGACY_CLAWDHUB_HOSTS = new Set(['clawdhub.com', 'www.clawdhub.com', 'auth.clawdhub.com'])
|
||||
const LEGACY_CLAWDHUB_HOSTS = new Set(['clawdhub.com', 'www.clawdhub.com', 'auth.clawhub.com'])
|
||||
|
||||
export function normalizeClawHubSiteOrigin(value?: string | null) {
|
||||
if (!value) return null
|
||||
|
||||
Reference in New Issue
Block a user