0c293b0615
* fix(fe2): reverting vue/nuxt downgrade * fix for broken vue 3.3 build? * storybook fix * storybook fix * fe2 storybook update * minor update to rerun CI
25 lines
774 B
TypeScript
25 lines
774 B
TypeScript
import { useApolloClientFromNuxt } from '~~/lib/common/composables/graphql'
|
|
import { useAuthCookie } from '~~/lib/auth/composables/auth'
|
|
|
|
export default defineNuxtPlugin(() => {
|
|
const logger = useLogger()
|
|
|
|
if (!process.dev) return
|
|
if (!process.client) return
|
|
|
|
logger.debug('🚧 Running FE2 in dev mode, extra debugging tools may be available...')
|
|
|
|
const authToken = useAuthCookie()
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-expect-error
|
|
window.AUTH_TOKEN = {
|
|
set: (newVal?: string) => (authToken.value = newVal || undefined),
|
|
get: () => authToken.value
|
|
}
|
|
|
|
const client = useApolloClientFromNuxt()
|
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-expect-error
|
|
window.APOLLO_CLIENT = client
|
|
})
|