diff --git a/src/features/App/index.tsx b/src/features/App/index.tsx
index f034ae04..190e4ea6 100644
--- a/src/features/App/index.tsx
+++ b/src/features/App/index.tsx
@@ -8,7 +8,7 @@ import { client } from 'config/clients'
import { matomoInstance } from 'config/matomo'
import { setClientTitleAndDescription } from 'helpers/setClientHeads'
-import { isMatchPage } from 'helpers/isMatchPage'
+import { isMatchPage, isMatchPageRFEF } from 'helpers/isMatchPage'
import { GlobalStores } from 'features/GlobalStores'
import { useAuthStore } from 'features/AuthStore'
@@ -25,8 +25,8 @@ setClientTitleAndDescription(client.title, client.description)
const Main = () => {
const { loadingUser, user } = useAuthStore()
- if (!user && isMatchPage() && !window.location.href.includes('1rfef')) return
- if (!user && window.location.href.includes('1rfef')) return
+ if (!user && isMatchPage() && !isMatchPageRFEF() && !window.location.href.includes('1rfef')) return
+ if (!user && isMatchPageRFEF() && !isMatchPage() && window.location.href.includes('1rfef')) return
// юзер считывается из localstorage или
// access_token токен истек и запрашивается новый
diff --git a/src/features/AuthStore/hooks/useAuth.tsx b/src/features/AuthStore/hooks/useAuth.tsx
index fbd080a1..f9387124 100644
--- a/src/features/AuthStore/hooks/useAuth.tsx
+++ b/src/features/AuthStore/hooks/useAuth.tsx
@@ -18,7 +18,7 @@ import {
} from 'helpers/languageUrlParam'
import { writeToken, removeToken } from 'helpers/token'
import { setCookie, removeCookie } from 'helpers/cookie'
-import { isMatchPage } from 'helpers/isMatchPage'
+import { isMatchPage, isMatchPageRFEF } from 'helpers/isMatchPage'
import { useLocalStore, useToggle } from 'hooks'
@@ -124,9 +124,12 @@ export const useAuth = () => {
signinRedirectCallback()
} else {
checkUser().catch(() => {
- if (!isMatchPage()) {
+ if (!isMatchPage() && !isMatchPageRFEF()) {
login()
}
+ // if (!isMatchPageRFEF()) {
+ // login()
+ // }
if (history.location.pathname === '/') {
setSearch(history.location.search)
}
diff --git a/src/helpers/isMatchPage/index.tsx b/src/helpers/isMatchPage/index.tsx
index 3a8729cc..8fd23db0 100644
--- a/src/helpers/isMatchPage/index.tsx
+++ b/src/helpers/isMatchPage/index.tsx
@@ -8,3 +8,11 @@ export const isMatchPage = () => {
return pageType === 'matches' && !isUndefined(matchId)
}
+
+export const isMatchPageRFEF = () => {
+ const splitPath = window.location.pathname.split('/')
+ const pageType = splitPath[3]
+ const matchId = toNumber(splitPath[3])
+
+ return pageType === 'matches' && !isUndefined(matchId)
+}