From 134a621d0d8c6aea4315e41e6156b7b98d3cbc14 Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Sun, 16 Nov 2025 22:36:11 +0000 Subject: [PATCH] fix: use ref rather than direct val (#4785) --- apps/frontend/src/app.vue | 2 +- apps/frontend/src/helpers/api.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/frontend/src/app.vue b/apps/frontend/src/app.vue index d37d0e71..5af1c1be 100644 --- a/apps/frontend/src/app.vue +++ b/apps/frontend/src/app.vue @@ -17,7 +17,7 @@ const config = useRuntimeConfig() provideNotificationManager(new FrontendNotificationManager()) -const client = createModrinthClient(auth.value, { +const client = createModrinthClient(auth, { apiBaseUrl: config.public.apiBaseUrl.replace('/v2/', '/'), archonBaseUrl: config.public.pyroBaseUrl.replace('/v2/', '/'), rateLimitKey: config.rateLimitKey, diff --git a/apps/frontend/src/helpers/api.ts b/apps/frontend/src/helpers/api.ts index 4cee73fa..02e8ee39 100644 --- a/apps/frontend/src/helpers/api.ts +++ b/apps/frontend/src/helpers/api.ts @@ -8,9 +8,10 @@ import { NuxtModrinthClient, VerboseLoggingFeature, } from '@modrinth/api-client' +import type { Ref } from 'vue' export function createModrinthClient( - auth: { token: string | undefined }, + auth: Ref<{ token: string | undefined }>, config: { apiBaseUrl: string; archonBaseUrl: string; rateLimitKey?: string }, ): NuxtModrinthClient { const optionalFeatures = [ @@ -23,7 +24,7 @@ export function createModrinthClient( rateLimitKey: config.rateLimitKey, features: [ new AuthFeature({ - token: async () => auth.token, + token: async () => auth.value.token, } as AuthConfig), new CircuitBreakerFeature({ storage: new NuxtCircuitBreakerStorage(),