Skip to content

Commit

Permalink
fix: fixed endpoint can't be set manually
Browse files Browse the repository at this point in the history
  • Loading branch information
shayan-deriv committed Jun 19, 2024
1 parent 53f0c71 commit 6c3cc54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/constants/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ export const getOauthUrl = () => {
const origin = window.location.origin;
const hostname = window.location.hostname;

const existingAppId = LocalStorageUtils.getValue(LocalStorageConstants.configAppId);
const existingServerUrl = localStorage.getItem(LocalStorageConstants.configServerURL.toString());
// since we don't have official app_id for staging,
// we will use the red server with app_id=62019 for the staging-p2p.deriv.com for now
// to fix the login issue
if (origin === URLConstants.derivP2pStaging) {
if ((!existingAppId || !existingServerUrl) && origin === URLConstants.derivP2pStaging) {
localStorage.setItem(
LocalStorageConstants.configServerURL.toString(),
SocketURL[origin as keyof typeof SocketURL]
Expand Down

0 comments on commit 6c3cc54

Please sign in to comment.