Skip to content

Commit 03e9006

Browse files
Merge pull request #135 from shayan-deriv/shayan/FEQ-2378/set-default-app-id-and-server-url-for-staging-p2p
fix: fix app_id empty in staging
2 parents a01f7f0 + d0ee8c0 commit 03e9006

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/constants/url.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,20 @@ const SocketURL = {
1919
};
2020

2121
export const getOauthUrl = () => {
22-
const hostname = window.location.origin;
22+
const origin = window.location.origin;
23+
const hostname = window.location.hostname;
2324

2425
// since we don't have official app_id for staging,
2526
// we will use the red server with app_id=62019 for the staging-p2p.deriv.com for now
2627
// to fix the login issue
27-
if (hostname === URLConstants.derivP2pStaging) {
28+
if (origin === URLConstants.derivP2pStaging) {
2829
localStorage.setItem(
2930
LocalStorageConstants.configServerURL.toString(),
30-
SocketURL[hostname as keyof typeof SocketURL]
31+
SocketURL[origin as keyof typeof SocketURL]
3132
);
3233
localStorage.setItem(
3334
LocalStorageConstants.configAppId,
34-
`https://${AppIDConstants.domainAppId[hostname as keyof typeof AppIDConstants.domainAppId]}`
35+
`${AppIDConstants.domainAppId[hostname as keyof typeof AppIDConstants.domainAppId]}`
3536
);
3637
}
3738

0 commit comments

Comments
 (0)