feat : formating code by prettier

This commit is contained in:
alij
2024-07-03 14:56:29 +03:30
parent 790ed79605
commit efa148c7ac
19 changed files with 289 additions and 84 deletions

View File

@@ -1,5 +1,6 @@
import { useSelector } from "react-redux";
import { RootState } from "../redux/store";
import toast from "react-hot-toast";
const isTokenValid = (token: string): boolean => {
try {
@@ -8,11 +9,12 @@ const isTokenValid = (token: string): boolean => {
return !!token;
} catch (error) {
console.error("Token validation error:", error);
toast.error(`Token validation error:${error}`);
return false;
}
};
export const isAuthenticated = () : boolean => {
const {token} = useSelector((state : RootState) => state.token)
export const IsAuthenticated = (): boolean => {
const { token } = useSelector((state: RootState) => state.token);
return isTokenValid(token);
};