123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
- import type { RouteRecordRaw } from 'vue-router'
- export const isMainRoute = true
- const route: RouteRecordRaw[] = [
- {
- path: '/login',
- name: 'Login',
- component: () => import('./views/Login.vue'),
- meta: {
- title: __('Sign in'),
- requiresAuth: false,
- requiredPermission: null,
- redirectToDefaultRoute: true,
- hasOwnLandmarks: true,
- sidebar: false,
- },
- },
- {
- path: '/admin-password-auth',
- name: 'AdminPasswordAuth',
- component: () => import('./views/AdminPasswordAuth.vue'),
- meta: {
- title: __('Admin Password Login'),
- requiresAuth: false,
- requiredPermission: null,
- redirectToDefaultRoute: true,
- hasOwnLandmarks: true,
- sidebar: false,
- },
- },
- {
- path: '/login/after-auth',
- name: 'LoginAfterAuth',
- component: () => import('./views/LoginAfterAuth.vue'),
- meta: {
- requiresAuth: true,
- requiredPermission: null,
- hasOwnLandmarks: true,
- sidebar: false,
- },
- },
- {
- path: '/reset-password',
- name: 'PasswordReset',
- component: () => import('./views/PasswordReset.vue'),
- meta: {
- requiresAuth: false,
- requiredPermission: null,
- redirectToDefaultRoute: true,
- hasOwnLandmarks: true,
- sidebar: false,
- },
- },
- {
- path: '/reset-password/verify/:token?',
- name: 'PasswordResetVerify',
- props: true,
- component: () => import('./views/PasswordResetVerify.vue'),
- meta: {
- requiresAuth: false,
- requiredPermission: null,
- redirectToDefaultRoute: true,
- hasOwnLandmarks: true,
- sidebar: false,
- },
- },
- {
- path: '/logout',
- name: 'Logout',
- component: {
- async beforeRouteEnter() {
- const [{ useAuthenticationStore }, { useNotifications }] =
- await Promise.all([
- import('#shared/stores/authentication.ts'),
- import(
- '#shared/components/CommonNotifications/useNotifications.ts'
- ),
- ])
- const { clearAllNotifications } = useNotifications()
- const authentication = useAuthenticationStore()
- clearAllNotifications()
- await authentication.logout()
- if (authentication.externalLogout) return false
- return '/login'
- },
- },
- meta: {
- requiresAuth: false,
- requiredPermission: null,
- },
- },
- {
- path: '/signup',
- name: 'Signup',
- component: () => import('./views/Signup.vue'),
- meta: {
- title: __('Sign up'),
- requiresAuth: false,
- requiredPermission: null,
- redirectToDefaultRoute: true,
- hasOwnLandmarks: true,
- sidebar: false,
- },
- },
- {
- path: '/signup/verify/:token?',
- name: 'SignupVerify',
- props: true,
- component: () => import('./views/SignupVerify.vue'),
- meta: {
- title: __('Email Verification'),
- requiresAuth: false,
- requiredPermission: null,
- redirectToDefaultRoute: true,
- hasOwnLandmarks: true,
- sidebar: false,
- },
- },
- ]
- export default route
|