From 4e82d94ff8b11006263ef251774c1f40611a7736 Mon Sep 17 00:00:00 2001 From: fasihali-deriv <121229483+fasihali-deriv@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:19:46 +0800 Subject: [PATCH] Fasih/DPROD-1799/Added dbot app id to redirect on dbot dashboard (#7379) * chore: added dbot app id to redirect on dbot dashboard * chore: updated login file * fix: fixed login issue * chore: updated app id in constant --------- Co-authored-by: Muhammad Fasih Ali Naqvi --- themes/gatsby-theme-deriv/src/common/constants.ts | 1 + themes/gatsby-theme-deriv/src/common/login.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/gatsby-theme-deriv/src/common/constants.ts b/themes/gatsby-theme-deriv/src/common/constants.ts index 0137b2d947f..8810b5a7ea9 100644 --- a/themes/gatsby-theme-deriv/src/common/constants.ts +++ b/themes/gatsby-theme-deriv/src/common/constants.ts @@ -10,6 +10,7 @@ export const deriv_com_app_id = 16929 export const deriv_me_app_id = 1411 export const deriv_be_app_id = 30767 export const deriv_ctrader_app_id = 36218 +export const deriv_bot_app_id = 19111 const domain_url_pair = { [deriv_com_url]: deriv_com_url, diff --git a/themes/gatsby-theme-deriv/src/common/login.ts b/themes/gatsby-theme-deriv/src/common/login.ts index 217c681596c..cf132e7c1a6 100644 --- a/themes/gatsby-theme-deriv/src/common/login.ts +++ b/themes/gatsby-theme-deriv/src/common/login.ts @@ -3,7 +3,7 @@ import { isStorageSupported } from './storage' import { getCookiesFields, getCookiesObject, getDataLink, getDataObjFromCookies } from './cookies' import { getAppId } from './websocket/config' import { isBrowser, redirectToTradingPlatform } from './utility' -import { brand_name, deriv_app_id, oauth_url } from 'common/constants' +import { brand_name, deriv_app_id, deriv_bot_app_id, oauth_url } from 'common/constants' export type TSocialProvider = 'google' | 'facebook' | 'apple' @@ -34,6 +34,8 @@ const Login = (() => { const sub_url = redirectToTradingPlatform() + const mutated_deriv_app_id = sub_url[0] === 'bot' ? deriv_bot_app_id : deriv_app_id + if (is_academy) { if (server_url && /qa/.test(server_url)) { return `https://${server_url}/oauth2/authorize?app_id=37228&l=${language}&brand=${brand_name.toLowerCase()}${affiliate_token_link}${cookies_link}&platform=${sub_url}` @@ -43,7 +45,7 @@ const Login = (() => { if (server_url && /qa/.test(server_url)) { return `https://${server_url}/oauth2/authorize?app_id=${getAppId()}&l=${language}&brand=${brand_name.toLowerCase()}${affiliate_token_link}${cookies_link}&platform=${sub_url}` } - return `${oauth_url}/oauth2/authorize?app_id=${deriv_app_id}&l=${language}&brand=${brand_name.toLowerCase()}${affiliate_token_link}${cookies_link}&platform=${sub_url}` + return `${oauth_url}/oauth2/authorize?app_id=${mutated_deriv_app_id}&l=${language}&brand=${brand_name.toLowerCase()}${affiliate_token_link}${cookies_link}&platform=${sub_url}` } }