Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Fasih/DPROD-1799/Added dbot app id to redirect on dbot dashboard #7379

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions themes/gatsby-theme-deriv/src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions themes/gatsby-theme-deriv/src/common/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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}`
Expand All @@ -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}`
}
}

Expand Down
Loading