👽 Update the service IDs

This commit is contained in:
2025-11-09 14:13:02 +08:00
parent 8f6c5b01c6
commit 0a3e4b75fd
9 changed files with 16 additions and 16 deletions

View File

@@ -201,7 +201,7 @@ const apiBaseServer = useSolarNetworkUrl()
try {
const { data, error } = await useFetch<SnAccount>(
`${apiBaseServer}/id/accounts/${username.value}`,
`${apiBaseServer}/pass/accounts/${username.value}`,
{ server: true }
)

View File

@@ -138,7 +138,7 @@ const requestedScopes = computed(() => {
async function fetchClientInfo() {
try {
const queryString = window.location.search.slice(1)
clientInfo.value = await api(`/id/auth/open/authorize?${queryString}`)
clientInfo.value = await api(`/pass/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 }>(
"/id/auth/open/authorize",
"/pass/auth/open/authorize",
{
method: "POST",
body: new URLSearchParams({

View File

@@ -25,7 +25,7 @@ definePageMeta({
})
onMounted(() => {
const redirectUrl = `${apiBase}/id/auth/callback/${provider}${window.location.search}`
const redirectUrl = `${apiBase}/pass/auth/callback/${provider}${window.location.search}`
window.location.href = redirectUrl
})
</script>

View File

@@ -295,7 +295,7 @@ async function handleCreateAccount() {
error.value = null
try {
await api("/id/accounts", {
await api("/pass/accounts", {
method: "POST",
body: {
name: formModel.name,

View File

@@ -71,7 +71,7 @@ async function handleFindAccount() {
error.value = null
try {
challenge.value = await api("/id/auth/challenge", {
challenge.value = await api("/pass/auth/challenge", {
method: "POST",
body: {
platform: 1,
@@ -96,7 +96,7 @@ async function getFactors() {
error.value = null
try {
const availableFactors = await api<SnAuthFactor[]>(
`/id/auth/challenge/${challenge.value.id}/factors`
`/pass/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(
`/id/auth/challenge/${challenge.value.id}/factors/${selectedFactorId.value}`,
`/pass/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(`/id/auth/challenge/${challenge.value.id}`, {
challenge.value = await api(`/pass/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 }>("/id/auth/token", {
await api<{ token: string }>("/pass/auth/token", {
method: "POST",
body: {
grant_type: "authorization_code",

View File

@@ -90,7 +90,7 @@ const api = useSolarNetwork()
async function fetchOrder() {
try {
const resp = await api<SnWalletOrder>(
`/id/orders/${encodeURIComponent(orderId)}`
`/pass/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(`/id/orders/${encodeURIComponent(orderId)}/pay`, {
await api(`/pass/orders/${encodeURIComponent(orderId)}/pay`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ pin_code: pinCode.value })

View File

@@ -97,7 +97,7 @@ const api = useSolarNetwork()
async function fetchSpell() {
try {
const resp = await api(`/id/spells/${encodeURIComponent(spellWord)}`)
const resp = await api(`/pass/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(`/id/spells/${encodeURIComponent(spellWord)}/apply`, {
await api(`/pass/spells/${encodeURIComponent(spellWord)}/apply`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: newPassword.value