Skip to content

Commit a453e27

Browse files
committed
fix: fix login issues
1 parent fae3dba commit a453e27

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/components/shared/utils/config/config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,15 @@ export const generateOAuthURL = () => {
147147
const oauth_url = getOauthURL();
148148
const original_url = new URL(oauth_url);
149149
const configured_server_url = (LocalStorageUtils.getValue(LocalStorageConstants.configServerURL) ||
150+
localStorage.getItem('config.server_url') ||
150151
original_url.hostname) as string;
151152

152153
const valid_server_urls = ['green.derivws.com', 'red.derivws.com', 'blue.derivws.com'];
153-
if (!valid_server_urls.includes(JSON.stringify(configured_server_url))) {
154+
if (
155+
typeof configured_server_url === 'string'
156+
? !valid_server_urls.includes(configured_server_url)
157+
: !valid_server_urls.includes(JSON.stringify(configured_server_url))
158+
) {
154159
original_url.hostname = configured_server_url;
155160
}
156161
return original_url.toString() || oauth_url;

src/components/shared/utils/routes/routes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const getDerivDomain = (service: Service): string => {
6060
* Uses template literals to compose URLs dynamically.
6161
*/
6262
export const standalone_routes = {
63-
bot: '/',
63+
bot: `${window.location.origin}`,
6464
cashier: `${getDerivDomain('derivApp')}/cashier/`,
6565
cashier_deposit: `${getDerivDomain('derivApp')}/cashier/deposit`,
6666
cashier_p2p: `${getDerivDomain('derivApp')}/cashier/p2p`,
@@ -78,7 +78,7 @@ export const standalone_routes = {
7878
signup: `https://hub.deriv.com/tradershub/signup`,
7979
deriv_com: getDerivDomain('derivCom'),
8080
deriv_app: getDerivDomain('derivApp'),
81-
endpoint: '/endpoint',
81+
endpoint: `${window.location.origin}/endpoint`,
8282
account_limits: `${getDerivDomain('derivApp')}/account/account-limits`,
8383
help_center: `${getDerivDomain('derivCom')}/help-centre/`,
8484
responsible: `${getDerivDomain('derivCom')}/responsible/`,

0 commit comments

Comments
 (0)