diff --git a/src/features/HomePage/hooks.tsx b/src/features/HomePage/hooks.tsx index 4fb0f3c7..104cdf16 100644 --- a/src/features/HomePage/hooks.tsx +++ b/src/features/HomePage/hooks.tsx @@ -75,7 +75,7 @@ export const useHomePage = () => { timezoneOffset: getTimezoneOffset(selectedDate), }), // eslint-disable-next-line react-hooks/exhaustive-deps - [selectedDate, userInfo], + [selectedDate], ) useEffect(() => { diff --git a/src/helpers/callApi/logoutIfUnauthorized.tsx b/src/helpers/callApi/logoutIfUnauthorized.tsx index 2371f5eb..f7f68cdf 100644 --- a/src/helpers/callApi/logoutIfUnauthorized.tsx +++ b/src/helpers/callApi/logoutIfUnauthorized.tsx @@ -1,9 +1,11 @@ +import { removeToken } from '../token' + export const logoutIfUnauthorized = async (response: Response) => { /* отключили из-за доступа без авторизации */ - // if (response.status === 401 || response.status === 403) { - // removeToken() - // window.dispatchEvent(new Event('FORBIDDEN_REQUEST')) - // } + if (response.status === 401 || response.status === 403) { + removeToken() + window.dispatchEvent(new Event('FORBIDDEN_REQUEST')) + } const error = new Error(response.statusText) // eslint-disable-next-line no-console