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,9 +1,6 @@
import React, { useState } from "react";
import { useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import { getRole } from "@redux/roleSlice";
import { useLogout } from "@hooks/useLogout";
import { Loader } from "@components/Common/Loader/Loader";
@ -12,8 +9,6 @@ import "./logoutButton.scss";
export const LogoutButton = () => {
const [isLoggingOut, setIsLoggingOut] = useState(false);
const userRole = useSelector(getRole);
const navigate = useNavigate();
const { logout } = useLogout();
@ -24,7 +19,7 @@ export const LogoutButton = () => {
setIsLoggingOut(true);
logout();
setIsLoggingOut(false);
navigate(userRole === "ROLE_DEV" ? "/authdev" : "/auth");
navigate("/auth");
}}
>
{isLoggingOut ? <Loader /> : "Выйти"}