Files
speckle-server/packages/frontend-2/plugins/dev.ts
T
Kristaps Fabians Geikins eaf925b387 feat(fe-2): improved logging (#1684)
* feat(fe-2): improved logging

* yarn lock update

* attempted speckle/shared build fix

* helm updates

* Updates documentation for helm chart

---------

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2023-07-12 10:21:08 +03:00

19 lines
536 B
TypeScript

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
}
})