Skip to content

Commit

Permalink
fix: url with config.server_url due log in
Browse files Browse the repository at this point in the history
  • Loading branch information
maryia-matskevich-deriv committed Jan 17, 2025
1 parent e198ea0 commit b917e7c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/shared/utils/config/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LocalStorageConstants, LocalStorageUtils, URLUtils } from '@deriv-com/utils';
import { LocalStorageConstants, URLUtils } from '@deriv-com/utils';
import { isStaging } from '../url/helpers';

export const APP_IDS = {
Expand Down Expand Up @@ -146,8 +146,9 @@ export const generateOAuthURL = () => {
const { getOauthURL } = URLUtils;
const oauth_url = getOauthURL();
const original_url = new URL(oauth_url);
const configured_server_url = (LocalStorageUtils.getValue(LocalStorageConstants.configServerURL) ||
original_url.hostname) as string;
const configured_server_url = localStorage.getItem(
LocalStorageConstants.configServerURL || original_url.hostname
) as string;

const valid_server_urls = ['green.derivws.com', 'red.derivws.com', 'blue.derivws.com'];
if (!valid_server_urls.includes(configured_server_url)) {
Expand Down

0 comments on commit b917e7c

Please sign in to comment.