File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,12 @@ export const getOauthUrl = () => {
2222 const origin = window . location . origin ;
2323 const hostname = window . location . hostname ;
2424
25+ const existingAppId = LocalStorageUtils . getValue ( LocalStorageConstants . configAppId ) ;
26+ const existingServerUrl = LocalStorageUtils . getValue ( LocalStorageConstants . configServerURL ) ;
2527 // since we don't have official app_id for staging,
2628 // we will use the red server with app_id=62019 for the staging-p2p.deriv.com for now
2729 // to fix the login issue
28- if ( origin === URLConstants . derivP2pStaging ) {
30+ if ( ! / l o c a l h o s t / . test ( origin ) && ( ! existingAppId || ! existingServerUrl ) ) {
2931 localStorage . setItem (
3032 LocalStorageConstants . configServerURL . toString ( ) ,
3133 SocketURL [ origin as keyof typeof SocketURL ]
@@ -36,8 +38,8 @@ export const getOauthUrl = () => {
3638 ) ;
3739 }
3840
39- const storedServerUrl = localStorage . getItem ( LocalStorageConstants . configServerURL . toString ( ) ) ;
40- const serverUrl = / q a / . test ( storedServerUrl || '' ) ? storedServerUrl : 'oauth.deriv.com' ;
41+ const storedServerUrl = LocalStorageUtils . getValue ( LocalStorageConstants . configServerURL ) ;
42+ const serverUrl = / q a / . test ( String ( storedServerUrl ) ) ? storedServerUrl : 'oauth.deriv.com' ;
4143
4244 const appId = LocalStorageUtils . getValue ( LocalStorageConstants . configAppId ) ;
4345
You can’t perform that action at this time.
0 commit comments