From 568aa34ba1ed6dc659ce287bc4c94d35147af883 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Fri, 14 Nov 2025 22:11:45 +0800 Subject: [PATCH] :rewind: Revert ":alien: Update the service IDs" This reverts commit 0a3e4b75fd4c2d13276be23762d842ae4afee7be. --- app/components/CaptchaWidget.vue | 2 +- app/pages/accounts/[name].vue | 2 +- app/pages/auth/authorize.vue | 4 ++-- app/pages/auth/callback/[provider].vue | 2 +- app/pages/auth/create-account.vue | 2 +- app/pages/auth/login.vue | 10 +++++----- app/pages/orders/[id].vue | 4 ++-- app/pages/spells/[...word].vue | 4 ++-- app/stores/user.ts | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/components/CaptchaWidget.vue b/app/components/CaptchaWidget.vue index 28d61ad..66c7dbf 100644 --- a/app/components/CaptchaWidget.vue +++ b/app/components/CaptchaWidget.vue @@ -59,7 +59,7 @@ function handleSuccess(token: string) { // This function will be used to fetch configuration if needed, // Like the backend didn't embed the configuration properly. async function fetchConfiguration() { - const resp = await api<{ provider: string; apiKey: string }>("/pass/captcha") + const resp = await api<{ provider: string; apiKey: string }>("/id/captcha") provider.value = resp.provider apiKey.value = resp.apiKey } diff --git a/app/pages/accounts/[name].vue b/app/pages/accounts/[name].vue index fc8eb8a..0171a8a 100644 --- a/app/pages/accounts/[name].vue +++ b/app/pages/accounts/[name].vue @@ -201,7 +201,7 @@ const apiBaseServer = useSolarNetworkUrl() try { const { data, error } = await useFetch( - `${apiBaseServer}/pass/accounts/${username.value}`, + `${apiBaseServer}/id/accounts/${username.value}`, { server: true } ) diff --git a/app/pages/auth/authorize.vue b/app/pages/auth/authorize.vue index ddac411..f1a5db0 100644 --- a/app/pages/auth/authorize.vue +++ b/app/pages/auth/authorize.vue @@ -138,7 +138,7 @@ const requestedScopes = computed(() => { async function fetchClientInfo() { try { const queryString = window.location.search.slice(1) - clientInfo.value = await api(`/pass/auth/open/authorize?${queryString}`) + clientInfo.value = await api(`/id/auth/open/authorize?${queryString}`) checkIfNewApp() } catch (err) { error.value = @@ -159,7 +159,7 @@ async function handleAuthorize(authorize = true) { isAuthorizing.value = true try { const data = await api<{ redirectUri?: string }>( - "/pass/auth/open/authorize", + "/id/auth/open/authorize", { method: "POST", body: new URLSearchParams({ diff --git a/app/pages/auth/callback/[provider].vue b/app/pages/auth/callback/[provider].vue index 091a770..e2f2548 100644 --- a/app/pages/auth/callback/[provider].vue +++ b/app/pages/auth/callback/[provider].vue @@ -25,7 +25,7 @@ definePageMeta({ }) onMounted(() => { - const redirectUrl = `${apiBase}/pass/auth/callback/${provider}${window.location.search}` + const redirectUrl = `${apiBase}/id/auth/callback/${provider}${window.location.search}` window.location.href = redirectUrl }) diff --git a/app/pages/auth/create-account.vue b/app/pages/auth/create-account.vue index 753ccdd..5d16356 100644 --- a/app/pages/auth/create-account.vue +++ b/app/pages/auth/create-account.vue @@ -295,7 +295,7 @@ async function handleCreateAccount() { error.value = null try { - await api("/pass/accounts", { + await api("/id/accounts", { method: "POST", body: { name: formModel.name, diff --git a/app/pages/auth/login.vue b/app/pages/auth/login.vue index c52f4a5..9710aa4 100644 --- a/app/pages/auth/login.vue +++ b/app/pages/auth/login.vue @@ -71,7 +71,7 @@ async function handleFindAccount() { error.value = null try { - challenge.value = await api("/pass/auth/challenge", { + challenge.value = await api("/id/auth/challenge", { method: "POST", body: { platform: 1, @@ -96,7 +96,7 @@ async function getFactors() { error.value = null try { const availableFactors = await api( - `/pass/auth/challenge/${challenge.value.id}/factors` + `/id/auth/challenge/${challenge.value.id}/factors` ) factors.value = availableFactors.filter( (f: SnAuthFactor) => !challenge.value!.blacklistFactors.includes(f.id) @@ -123,7 +123,7 @@ async function requestVerificationCode() { try { await api( - `/pass/auth/challenge/${challenge.value.id}/factors/${selectedFactorId.value}`, + `/id/auth/challenge/${challenge.value.id}/factors/${selectedFactorId.value}`, { method: "POST" } ) } catch (e: unknown) { @@ -170,7 +170,7 @@ async function handleVerifyFactor() { error.value = null try { - challenge.value = await api(`/pass/auth/challenge/${challenge.value.id}`, { + challenge.value = await api(`/id/auth/challenge/${challenge.value.id}`, { method: "PATCH", body: { factor_id: selectedFactorId.value, @@ -202,7 +202,7 @@ async function exchangeToken() { error.value = null try { // The token endpoint gives the Set-Cookie header - await api<{ token: string }>("/pass/auth/token", { + await api<{ token: string }>("/id/auth/token", { method: "POST", body: { grant_type: "authorization_code", diff --git a/app/pages/orders/[id].vue b/app/pages/orders/[id].vue index 72e3dfd..2d2f34e 100644 --- a/app/pages/orders/[id].vue +++ b/app/pages/orders/[id].vue @@ -90,7 +90,7 @@ const api = useSolarNetwork() async function fetchOrder() { try { const resp = await api( - `/pass/orders/${encodeURIComponent(orderId)}` + `/id/orders/${encodeURIComponent(orderId)}` ) order.value = resp } catch (err: unknown) { @@ -101,7 +101,7 @@ async function fetchOrder() { async function pay() { submitting.value = true try { - await api(`/pass/orders/${encodeURIComponent(orderId)}/pay`, { + await api(`/id/orders/${encodeURIComponent(orderId)}/pay`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ pin_code: pinCode.value }) diff --git a/app/pages/spells/[...word].vue b/app/pages/spells/[...word].vue index 6df7c97..b3a8407 100644 --- a/app/pages/spells/[...word].vue +++ b/app/pages/spells/[...word].vue @@ -97,7 +97,7 @@ const api = useSolarNetwork() async function fetchSpell() { try { - const resp = await api(`/pass/spells/${encodeURIComponent(spellWord)}`) + const resp = await api(`/id/spells/${encodeURIComponent(spellWord)}`) spell.value = resp } catch (err: unknown) { error.value = err instanceof Error ? err.message : String(err) @@ -107,7 +107,7 @@ async function fetchSpell() { async function applySpell() { submitting.value = true try { - await api(`/pass/spells/${encodeURIComponent(spellWord)}/apply`, { + await api(`/id/spells/${encodeURIComponent(spellWord)}/apply`, { method: "POST", headers: { "Content-Type": "application/json" }, body: newPassword.value diff --git a/app/stores/user.ts b/app/stores/user.ts index 78ab030..2084d1e 100644 --- a/app/stores/user.ts +++ b/app/stores/user.ts @@ -32,7 +32,7 @@ export const useUserStore = defineStore("user", () => { error.value = null const api = useSolarNetwork() try { - const response = await api("/pass/accounts/me") + const response = await api("/id/accounts/me") user.value = response console.log(`[UserStore] Logged in as @${user.value.name}`) } catch (e: unknown) {