feat: location.pathname based bar navigation + admin layout + separate

auth routes
This commit is contained in:
2025-05-29 23:42:17 +02:00
parent 78e84567c7
commit db2cb36f54
14 changed files with 219 additions and 143 deletions

View File

@ -45,8 +45,7 @@ const AuthLayout = () => {
const navigate = useNavigate();
const isAuthPage = useMemo(() => {
const allowedPaths = ["/login", "/register", "/authenticate"];
return allowedPaths.some((p) => location.pathname.startsWith(p));
return location.pathname.startsWith("/auth");
}, [location.pathname]);
const loading = useMemo(() => {
@ -116,7 +115,7 @@ const AuthLayout = () => {
if (signInRequired && !isAuthPage) {
return (
<Navigate
to={hasAccounts ? "/authenticate" : "/login"}
to={hasAccounts ? "/auth/authenticate" : "/auth/login"}
state={{ from: location.pathname }}
/>
);