File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,12 @@ export const getOauthUrl = () => {
22
22
const origin = window . location . origin ;
23
23
const hostname = window . location . hostname ;
24
24
25
+ const existingAppId = LocalStorageUtils . getValue ( LocalStorageConstants . configAppId ) ;
26
+ const existingServerUrl = LocalStorageUtils . getValue ( LocalStorageConstants . configServerURL ) ;
25
27
// since we don't have official app_id for staging,
26
28
// we will use the red server with app_id=62019 for the staging-p2p.deriv.com for now
27
29
// 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 ) ) {
29
31
localStorage . setItem (
30
32
LocalStorageConstants . configServerURL . toString ( ) ,
31
33
SocketURL [ origin as keyof typeof SocketURL ]
@@ -36,8 +38,8 @@ export const getOauthUrl = () => {
36
38
) ;
37
39
}
38
40
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' ;
41
43
42
44
const appId = LocalStorageUtils . getValue ( LocalStorageConstants . configAppId ) ;
43
45
You can’t perform that action at this time.
0 commit comments