feat: location.pathname based bar navigation + admin layout + separate
auth routes
This commit is contained in:
@ -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 }}
|
||||
/>
|
||||
);
|
||||
|
Reference in New Issue
Block a user