83d8035dc2
* root + server * frontend * frontend-2 * dui3 * dui3 * tailwind theme * ui-components * preview service * viewer * viewer-sandbox * fileimport-service * webhook service * objectloader * shared * ui-components-nuxt * WIP full config * WIP full linter * eslint projectwide util * minor fix * removing redundant ci * clean up test errors * fixed prettier formatting * CI improvements * TSC lint fix * 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader * removed unnecessary void --------- Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
25 lines
782 B
TypeScript
25 lines
782 B
TypeScript
import { useApolloClientFromNuxt } from '~~/lib/common/composables/graphql'
|
|
import { useAuthCookie } from '~~/lib/auth/composables/auth'
|
|
|
|
export default defineNuxtPlugin(() => {
|
|
const logger = useLogger()
|
|
|
|
if (!import.meta.dev) return
|
|
if (!import.meta.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
|
|
})
|