Route audit admins into admin console

This commit is contained in:
RWDai
2026-05-14 13:38:45 +08:00
parent e818443841
commit a4e040a7d7
4 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ async function syncExternalAuthState(nextToken: string | null): Promise<void> {
return
}
if (router.currentRoute.value.path.startsWith('/admin') && user.role !== 'admin') {
if (router.currentRoute.value.path.startsWith('/admin') && !authStore.canAccessAdmin) {
await router.replace('/dashboard')
}
}