mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 21:27:10 +00:00
feat: authorization
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { useUserStore } from "@/shared/stores/user";
|
||||
import React from "react";
|
||||
import { Outlet } from "react-router";
|
||||
|
||||
export const AuthLayout = () => {
|
||||
const fetchUser = useUserStore((state) => state.fetchUser);
|
||||
|
||||
React.useEffect(() => {
|
||||
async function fetchData() {
|
||||
await fetchUser();
|
||||
}
|
||||
|
||||
fetchData();
|
||||
}, []);
|
||||
|
||||
return <Outlet />;
|
||||
};
|
||||
Reference in New Issue
Block a user