fixes
This commit is contained in:
parent
3f33811956
commit
9346a78600
@ -4,9 +4,24 @@ const emailRouteComponent = () => import('@/pages/apps/email/index.vue')
|
||||
export const redirects = [
|
||||
// ℹ️ We are redirecting to different pages based on role.
|
||||
// NOTE: Role is just for UI purposes. ACL is based on abilities.
|
||||
{
|
||||
path: '/admin',
|
||||
// name: 'index',
|
||||
redirect: to => {
|
||||
// TODO: Get type from backend
|
||||
const userData = useCookie('userData')
|
||||
const userRole = userData.value?.role
|
||||
if (userRole === 'admin')
|
||||
return { name: 'admin-dashboard' }
|
||||
if (userRole === 'client')
|
||||
return { name: 'access-control' }
|
||||
|
||||
return { name: 'login', query: to.query }
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
name: 'index',
|
||||
// name: 'index',
|
||||
redirect: to => {
|
||||
// TODO: Get type from backend
|
||||
const userData = useCookie('userData')
|
||||
|
Loading…
Reference in New Issue
Block a user