UNPKG

@enso-ui/auth

Version:

Authentication pages, auth store helpers, and password-strength utilities for Enso UI.

42 lines (39 loc) 932 B
const Login = () => import('../pages/auth/Login.vue'); const Email = () => import('../pages/auth/password/EmailResetLink.vue'); const Reset = () => import('../pages/auth/password/Reset.vue'); import { auth } from '../../pinia/auth'; const redirect = (to, from, next) => { if (auth().isAuth) { next({ path: '/' }); } else { next(); } }; export default [{ name: 'login', path: '/login', component: Login, beforeEnter: redirect, meta: { guestGuard: true, title: 'Login', }, }, { path: '/password/reset', name: 'password.email', component: Email, beforeEnter: redirect, meta: { guestGuard: true, title: 'Email Reset Link', }, }, { path: '/password/reset/:token', name: 'password.reset', component: Reset, beforeEnter: redirect, meta: { guestGuard: true, title: 'Reset Password', }, }];