diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index 60e9908c..356607e9 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -1,8 +1,6 @@ import type { UserManagerSettings } from 'oidc-client' import { WebStorageStateStore } from 'oidc-client' -import includes from 'lodash/includes' - import { client } from 'config/clients' import { AUTH_SERVICE } from 'config/routes' import { ClientIds, ClientNames } from 'config/clients/types' @@ -59,6 +57,4 @@ export const getClientSettings = (): Settings => ({ userStore: new WebStorageStateStore({ store: window.localStorage }), }) -const disableCheckNewDeviceClients = ['lff', 'facr'] - -export const noCheckNewDevise = includes(disableCheckNewDeviceClients, client.name) +export const needCheckNewDeviсe = client.name === 'instat' || client.name === 'insports' diff --git a/src/features/AuthStore/hooks/useAuth.tsx b/src/features/AuthStore/hooks/useAuth.tsx index 45e8a76e..b4a4b176 100644 --- a/src/features/AuthStore/hooks/useAuth.tsx +++ b/src/features/AuthStore/hooks/useAuth.tsx @@ -29,7 +29,7 @@ import { queryParamStorage } from 'features/QueryParamsStorage' import { getUserInfo } from 'requests/getUserInfo' import { checkDevice, FailedResponse } from 'requests/checkDevice' -import { getClientSettings, noCheckNewDevise } from '../helpers' +import { getClientSettings, needCheckNewDeviсe } from '../helpers' export const useAuth = () => { const { changeLang, lang } = useLexicsStore() @@ -167,7 +167,7 @@ export const useAuth = () => { }, [reChekNewDevice, userManager]) useEffect(() => { - if (noCheckNewDevise) return undefined + if (!needCheckNewDeviсe) return undefined const startCheckDevice = setInterval(checkNewDevice, 20000) isNewDeviceLogin && clearInterval(startCheckDevice) return () => clearInterval(startCheckDevice)