From 113c51b90ad0d95601e028ddb67e5e18f0acf6ac Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Wed, 15 Jun 2022 20:21:48 +0700 Subject: [PATCH] fix(#2519): add new condition for lff auth --- src/features/AuthStore/helpers.tsx | 14 +++++++------- src/react-app-env.d.ts | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index 3d4b6bc0..2ad4db04 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -30,14 +30,14 @@ const getClientNameByRedirectUri = () => { const redirectUrl = () => { const clientName = getClientNameByRedirectUri() - - if (process.env.NODE_ENV === 'development') { - return `${window.origin}/redirect` - } - if (ENV === 'staging' || ENV === 'preproduction') { - return `https://${stageENV}.instat.tv/redirect` + switch (true) { + case (process.env.NODE_ENV === 'development' || client.name === 'lff'): + return `${window.origin}/redirect` + case (ENV === 'staging' || ENV === 'preproduction'): + return `https://${stageENV}.instat.tv/redirect` + default: + return `https://${clientName}.tv/redirect` } - return `https://${clientName}.tv/redirect` } export const getClientSettings = (): Settings => ({ diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 5687a3a1..9544e295 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -5,7 +5,7 @@ declare namespace NodeJS { export interface ProcessEnv { REACT_APP_CLIENT: 'instat' | 'facr' | 'lff', REACT_APP_ENV: 'production' | 'preproduction' | 'staging', - REACT_APP_STAGE: 'staging' | 'a-staging' | 'b-staging' | 'c-staging' | 'd-staging' | 'e-staging', + REACT_APP_STAGE: 'staging' | 'a-staging' | 'b-staging' | 'c-staging' | 'd-staging' | 'e-staging' | 'f-staging' | 'g-staging' | 'h-staging' | 'i-staging', REACT_APP_TYPE: 'auth-service' | 'ott', } }