diff --git a/src/features/AuthServiceApp/config/routes.tsx b/src/features/AuthServiceApp/config/routes.tsx index 2cfe4c3d..30ba0ea8 100644 --- a/src/features/AuthServiceApp/config/routes.tsx +++ b/src/features/AuthServiceApp/config/routes.tsx @@ -1,4 +1,6 @@ -import { ENV } from 'config/env' +import { ENV, isProduction } from 'config/env' + +import { readSelectedApi } from 'helpers/selectedApi' const APIS = { preproduction: 'https://api.auth.insports.tv', @@ -6,7 +8,9 @@ const APIS = { staging: 'https://api.auth.test.insports.tv', } -export const API_ROOT = APIS[ENV] +const env = isProduction ? ENV : readSelectedApi() ?? ENV + +export const API_ROOT = APIS[env] export const getApiUrl = (path: string) => ( `${API_ROOT}${path}${window.location.search}`