9 lines
251 B
TypeScript
9 lines
251 B
TypeScript
// Middleware to redirect authenticated users away from guest-only pages
|
|
export default defineNuxtRouteMiddleware((to, from) => {
|
|
const { status } = useAuth();
|
|
|
|
if (status.value === 'authenticated') {
|
|
return navigateTo('/');
|
|
}
|
|
});
|