Getting a 500 server error when trying to access nuxtApp.$auth in middleware.
Only started occurring after upgrading to the latest. Was previously on versions nuxt rc.8 and nuxtjs-alt/auth 1.2.4 but upgraded to nuxt rc.9 and nuxtjs-alt/auth 2.0.14 and this error started occurring.
export default defineNuxtRouteMiddleware(async (to, from) => {
const app = useNuxtApp();
// If user is trying to access a restricted page without authentication redirect to login page
if (!app.$auth.loggedIn) {
return navigateTo({
name: "login",
query: to.query,
});
}
});
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Getting a 500 server error when trying to access
nuxtApp.$auth
in middleware.Only started occurring after upgrading to the latest. Was previously on versions
nuxt rc.8
andnuxtjs-alt/auth 1.2.4
but upgraded tonuxt rc.9
andnuxtjs-alt/auth 2.0.14
and this error started occurring.