Skip to content

Commit 7da58d7

Browse files
authoredDec 19, 2024
[Fix] SIWE check in packaged app (#1199)
* check * update debug log * fix domain and origin for siwe request, rm debug logs
1 parent f662464 commit 7da58d7

File tree

1 file changed

+7
-4
lines changed
  • src/backend/storeManagers/hyperplay

1 file changed

+7
-4
lines changed
 

‎src/backend/storeManagers/hyperplay/games.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1404,10 +1404,13 @@ async function createSiweMessage(signerAddress: string): Promise<SiweMessage> {
14041404
throw 'could not get main window url'
14051405
}
14061406
const url = new URL(mainWindowUrl)
1407-
const domain = url.host ? url.host : 'hyperplay'
1408-
const origin = url.origin.startsWith('file://')
1409-
? 'file://hyperplay'
1410-
: url.origin
1407+
let domain = url.host
1408+
let origin = url.origin
1409+
// host is empty string and origin is null on the artifact
1410+
if (url.protocol === 'file:') {
1411+
domain = 'hyperplay'
1412+
origin = 'file://hyperplay'
1413+
}
14111414

14121415
const statementRes = await fetch(
14131416
DEV_PORTAL_URL + 'api/v1/license_contracts/validate/get-nonce'

0 commit comments

Comments
 (0)