Skip to content

Commit f4e2668

Browse files
committed
fix: use ref rather than direct val
1 parent 744e124 commit f4e2668

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

apps/frontend/src/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const config = useRuntimeConfig()
1717
1818
provideNotificationManager(new FrontendNotificationManager())
1919
20-
const client = createModrinthClient(auth.value, {
20+
const client = createModrinthClient(auth, {
2121
apiBaseUrl: config.public.apiBaseUrl.replace('/v2/', '/'),
2222
archonBaseUrl: config.public.pyroBaseUrl.replace('/v2/', '/'),
2323
rateLimitKey: config.rateLimitKey,

apps/frontend/src/helpers/api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import {
88
NuxtModrinthClient,
99
VerboseLoggingFeature,
1010
} from '@modrinth/api-client'
11+
import type { Ref } from 'vue'
1112

1213
export function createModrinthClient(
13-
auth: { token: string | undefined },
14+
auth: Ref<{ token: string | undefined }>,
1415
config: { apiBaseUrl: string; archonBaseUrl: string; rateLimitKey?: string },
1516
): NuxtModrinthClient {
1617
const optionalFeatures = [
@@ -23,7 +24,7 @@ export function createModrinthClient(
2324
rateLimitKey: config.rateLimitKey,
2425
features: [
2526
new AuthFeature({
26-
token: async () => auth.token,
27+
token: async () => auth.value.token,
2728
} as AuthConfig),
2829
new CircuitBreakerFeature({
2930
storage: new NuxtCircuitBreakerStorage(),

0 commit comments

Comments
 (0)