10 lines
337 B
TypeScript
10 lines
337 B
TypeScript
export default defineNuxtRouteMiddleware(() => {
|
|
const auth = useAuthStore()
|
|
|
|
// "Mes absences" is reserved for users flagged as employees (subject to the
|
|
// absence management). Non-employees are redirected to the home page.
|
|
if (!auth.isAuthenticated || !auth.user?.isEmployee) {
|
|
return navigateTo('/')
|
|
}
|
|
})
|