Browse Source

fix: secret page only for admin

stage
Vitalik 3 months ago
parent
commit
2384d13d68
  1. 13
      src/containers/SecretMod/secret-mod.page.tsx

13
src/containers/SecretMod/secret-mod.page.tsx

@ -1,8 +1,21 @@ @@ -1,8 +1,21 @@
import React from "react";
import { Container } from "reactstrap";
import { SecretModControllerWidget, SecretUsersWidget } from "./widgets";
import { useSelector } from "react-redux";
import { getProfile } from "@/store/account";
import { useHistory } from "react-router-dom";
import { EUserRole } from "@/shared";
export const SecretModPage = () => {
const profile = useSelector(getProfile);
const history = useHistory();
if (profile?.role !== EUserRole.Admin) {
history.push("/");
return null;
}
return (
<Container className="factory">
<SecretModControllerWidget />

Loading…
Cancel
Save