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

Commit

Permalink
Fasih/DPROD-1799/Added dbot app id to redirect on dbot dashboard (#7379)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
fasihali-deriv and Muhammad Fasih Ali Naqvi authored Apr 18, 2024
1 parent d7826a1 commit 4e82d94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 4e82d94

Please sign in to comment.