12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- // Copyright (C) 2012-2023 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,
- hasOwnLandmarks: true,
- },
- },
- {
- path: '/logout',
- name: 'Logout',
- component: {
- async beforeRouteEnter() {
- const [{ useAuthenticationStore }, { useNotifications }] =
- await Promise.all([
- import('@shared/stores/authentication'),
- import('@shared/components/CommonNotifications/composable'),
- ])
- const { clearAllNotifications } = useNotifications()
- const authentication = useAuthenticationStore()
- clearAllNotifications()
- await authentication.logout()
- if (authentication.externalLogout) return false
- return '/login'
- },
- },
- meta: {
- requiresAuth: false,
- requiredPermission: null,
- },
- },
- ]
- export default route
|