11 lines
344 B
TypeScript
11 lines
344 B
TypeScript
|
|
import { createAuth0 } from '@auth0/auth0-vue'
|
||
|
|
import { defineNuxtPlugin } from '#app'
|
||
|
|
import { envConfig } from '~/utils/environment'
|
||
|
|
|
||
|
|
export default defineNuxtPlugin((nuxtApp) => {
|
||
|
|
const options = envConfig(window.location.hostname).auth
|
||
|
|
const auth0 = createAuth0(options)
|
||
|
|
nuxtApp.vueApp.use(auth0)
|
||
|
|
nuxtApp.provide('auth0', auth0)
|
||
|
|
})
|