Hello!!! currently I’m getting some issue, this is my code:
app.ts
import { createApp as createClientApp } from 'vue'
import { createHead } from '@unhead/vue'
import { InferSeoMetaPlugin } from '@unhead/addons'
import { createPinia } from 'pinia'
import { createRouter } from './router'
import VueroApp from './VueroApp.vue'
import './styles'
import { createAuth0 } from '@auth0/auth0-vue'
export type VueroAppContext = Awaited<ReturnType<typeof createApp>>
export type VueroPlugin = (vuero: VueroAppContext) => void | Promise<void>
const plugins = import.meta.glob<{ default: VueroPlugin }>('./plugins/*.ts')
// this is a helper function to define plugins with autocompletion
export function definePlugin(plugin: VueroPlugin) {
return plugin
}
export async function createApp() {
const app = createClientApp(VueroApp)
const router = createRouter()
const head = createHead({
plugins: [InferSeoMetaPlugin()],
})
app.use(head)
const pinia = createPinia()
app.use(pinia)
const vuero = {
app,
router,
head,
pinia,
}
app.provide('vuero', vuero)
for (const path in plugins) {
try {
const { default: plugin } = await plugins[path]()
await plugin(vuero)
} catch (error) {
console.error(`Error while loading plugin "${path}".`)
console.error(error)
}
}
// use router after plugin registration, so we can register navigation guards
app.use(vuero.router)
.use(
createAuth0({
domain: import.meta.env.VITE_AUTH0_DOMAIN,
clientId: import.meta.env.VITE_AUTH0_CLIENT_ID,
authorizationParams: {
redirect_uri: import.meta.env.VITE_AUTH0_CALLBACK_URL,
},
})
)
return vuero
}
indes.vue page
<script setup lang="ts">
import { useAuth0 } from "@auth0/auth0-vue";
const { loginWithRedirect } = useAuth0();
const router = useRouter()
//default redirect to Universal Login of Auth0
loginWithRedirect({
appState: {
target: "/app",
},
authorizationParams: {
prompt: "login",
},
})
</script>
<template>
<template>
the aplication start showing de universal login, then, I write de email and password and I clicked on button Log In, so, the page load and stay on universal login, what’s wrong???