mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-05-06 13:48:55 +00:00
Dashboard Redesign (#48)
* feat: add user_template setting * style: header * style: page padding * style: header * feat: header now time * style: login page * feat: nav indicator * style: button inset shadow * style: footer text size * feat: header show login_ip * fix: error toast * fix: frontend_templates setting * fix: lint * feat: pr auto format * chore: auto-fix linting and formatting issues --------- Co-authored-by: hamster1963 <hamster1963@users.noreply.github.com>
This commit is contained in:
+13
-10
@@ -1,16 +1,19 @@
|
||||
import { Navigate } from "react-router-dom";
|
||||
import { useAuth } from "@/hooks/useAuth";
|
||||
import { useAuth } from "@/hooks/useAuth"
|
||||
import { Navigate } from "react-router-dom"
|
||||
|
||||
export const ProtectedRoute = ({ children }: {
|
||||
children: React.ReactNode;
|
||||
}) => {
|
||||
const { profile } = useAuth();
|
||||
export const ProtectedRoute = ({ children }: { children: React.ReactNode }) => {
|
||||
const { profile } = useAuth()
|
||||
|
||||
if (!profile && window.location.pathname !== "/dashboard/login") {
|
||||
return <><Navigate to="/dashboard/login" />{children}</>;
|
||||
return (
|
||||
<>
|
||||
<Navigate to="/dashboard/login" />
|
||||
{children}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
return children;
|
||||
};
|
||||
return children
|
||||
}
|
||||
|
||||
export default ProtectedRoute;
|
||||
export default ProtectedRoute
|
||||
|
||||
Reference in New Issue
Block a user