remove auth for dev

This commit is contained in:
Victor Batischev
2023-12-04 18:36:02 +03:00
parent 5bfc953ecc
commit d4eba820e0
11 changed files with 28 additions and 420 deletions

View File

@ -1,18 +1,16 @@
import { useDispatch, useSelector } from "react-redux";
import { useDispatch } from "react-redux";
import { useNavigate } from "react-router-dom";
import { auth } from "../redux/outstaffingSlice";
import { getRole } from "../redux/roleSlice";
export const useLogout = () => {
const dispatch = useDispatch();
const userRole = useSelector(getRole);
const navigate = useNavigate();
const logout = () => {
localStorage.clear();
dispatch(auth(false));
navigate(userRole === "ROLE_DEV" ? "/authdev" : "/auth");
navigate("/auth");
};
return { logout };