From 4c7a7e4865fec785a20caa80db79c72e2c6d2da2 Mon Sep 17 00:00:00 2001 From: Rakov Roman Date: Mon, 14 Nov 2022 11:19:24 +0300 Subject: [PATCH] fix(#169): auth api fix --- src/features/AuthServiceApp/components/Oauth/index.tsx | 4 ++-- src/features/AuthStore/helpers.tsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/features/AuthServiceApp/components/Oauth/index.tsx b/src/features/AuthServiceApp/components/Oauth/index.tsx index 124b9014..5c06e02a 100644 --- a/src/features/AuthServiceApp/components/Oauth/index.tsx +++ b/src/features/AuthServiceApp/components/Oauth/index.tsx @@ -10,7 +10,7 @@ import type { Settings } from 'features/AuthStore/helpers' import { getClientSettings } from 'features/AuthStore/helpers' import { T9n } from 'features/T9n' -import { API_ROOT } from '../../config/routes' +import { getApiUrl } from 'features/AuthServiceApp/config/routes' import { PAGES } from '../../config/pages' import { useOauth } from './hooks' import { @@ -28,7 +28,7 @@ import { Error, } from './styled' -const url = `${API_ROOT}/oauth` +const url = getApiUrl('/oauth') const Oauth = () => { const { diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index 3ba8ee70..7f8662a1 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -6,6 +6,8 @@ import { AUTH_SERVICE } from 'config/routes' import { ClientIds, ClientNames } from 'config/clients/types' import { ENV, stageENV } from 'config/env' +import { API_ROOT } from 'features/AuthServiceApp/config/routes' + export interface Settings extends UserManagerSettings { client_id: ClientIds, lang?: string, @@ -48,7 +50,7 @@ export const getClientSettings = (): Settings => ({ client_id: client.auth.clientId, filterProtocolClaims: false, loadUserInfo: false, - metadataUrl: `https://api.auth.test.insports.tv/.well-known/openid-configuration${client.auth.metaDataUrlParams || ''}`, + metadataUrl: `${API_ROOT}/.well-known/openid-configuration${client.auth.metaDataUrlParams || ''}`, redirect_uri: redirectUrl(), response_mode: 'query', response_type: 'id_token token',