diff --git a/packages/nuxt/src/runtime/plugins/thunderid.ts b/packages/nuxt/src/runtime/plugins/thunderid.ts index 100c788e..b45de129 100644 --- a/packages/nuxt/src/runtime/plugins/thunderid.ts +++ b/packages/nuxt/src/runtime/plugins/thunderid.ts @@ -1,8 +1,7 @@ // Copyright 2025 The ThunderID Authors // SPDX-License-Identifier: Apache-2.0 -import {getRedirectBasedSignUpUrl} from '@thunderid/browser'; -import {VendorConstants} from '@thunderid/node'; +import {getRedirectBasedSignUpUrl, getVendorPrefix} from '@thunderid/browser'; import type {AttributeSchema, UserProfile} from '@thunderid/node'; import {ThunderIDPlugin, THUNDERID_KEY} from '@thunderid/vue'; import type {H3Event} from 'h3'; @@ -58,7 +57,7 @@ export default defineNuxtPlugin((nuxtApp: NuxtApp) => { vendor?: string; }; - const vendor: string = publicConfig.vendor ?? VendorConstants.VENDOR_PREFIX; + const vendor: string = getVendorPrefix(publicConfig.vendor); // Surface misconfiguration in the browser dev console only. The server // counterpart is handled by the thunderid-ssr Nitro plugin; doing both diff --git a/packages/nuxt/src/runtime/utils/stateKeys.ts b/packages/nuxt/src/runtime/utils/stateKeys.ts index 3a0b92c9..9c2b82e0 100644 --- a/packages/nuxt/src/runtime/utils/stateKeys.ts +++ b/packages/nuxt/src/runtime/utils/stateKeys.ts @@ -1,7 +1,7 @@ // Copyright 2025 The ThunderID Authors // SPDX-License-Identifier: Apache-2.0 -import {getVendorPrefix} from '@thunderid/node'; +import {getVendorPrefix} from '@thunderid/browser'; /** * Shared `useState` key for the ThunderID auth state (`ThunderIDAuthState`). diff --git a/packages/nuxt/tests/unit/thunderid-root.test.ts b/packages/nuxt/tests/unit/thunderid-root.test.ts index 80e2cca9..9fb0eab3 100644 --- a/packages/nuxt/tests/unit/thunderid-root.test.ts +++ b/packages/nuxt/tests/unit/thunderid-root.test.ts @@ -26,6 +26,7 @@ vi.mock('@thunderid/vue', () => ({ vi.mock('@thunderid/browser', () => ({ generateFlattenedUserProfile: vi.fn((_user: any, _schemas: any) => ({email: 'updated@example.com'})), + getVendorPrefix: vi.fn((vendor?: string) => vendor ?? 'thunderid'), })); // Stub Nuxt composables so the component's setup() can run in pure Node.