Add Prettier for TypeScript formatting
- Install prettier - Configure .prettierrc.json and .prettierignore - Add npm scripts: format, format:check - Add Makefile target: format-frontend - Format all frontend files
This commit is contained in:
parent
4b394b0698
commit
37de6f70e0
44 changed files with 906 additions and 856 deletions
|
|
@ -46,11 +46,13 @@ export function useRequireAuth(options: UseRequireAuthOptions = {}): UseRequireA
|
|||
|
||||
if (!isAuthorized) {
|
||||
// Redirect to the most appropriate page based on permissions
|
||||
const redirect = fallbackRedirect ?? (
|
||||
hasPermission(Permission.VIEW_AUDIT) ? "/audit" :
|
||||
hasPermission(Permission.VIEW_COUNTER) ? "/" :
|
||||
"/login"
|
||||
);
|
||||
const redirect =
|
||||
fallbackRedirect ??
|
||||
(hasPermission(Permission.VIEW_AUDIT)
|
||||
? "/audit"
|
||||
: hasPermission(Permission.VIEW_COUNTER)
|
||||
? "/"
|
||||
: "/login");
|
||||
router.push(redirect);
|
||||
}
|
||||
}, [isLoading, user, isAuthorized, router, fallbackRedirect, hasPermission]);
|
||||
|
|
@ -61,4 +63,3 @@ export function useRequireAuth(options: UseRequireAuthOptions = {}): UseRequireA
|
|||
isAuthorized,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue