Skip to content

Commit

Permalink
[Fix] SIWE check in packaged app (#1199)
Browse files Browse the repository at this point in the history
* check

* update debug log

* fix domain and origin for siwe request, rm debug logs
  • Loading branch information
BrettCleary authored Dec 19, 2024
1 parent f662464 commit 7da58d7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/backend/storeManagers/hyperplay/games.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1404,10 +1404,13 @@ async function createSiweMessage(signerAddress: string): Promise<SiweMessage> {
throw 'could not get main window url'
}
const url = new URL(mainWindowUrl)
const domain = url.host ? url.host : 'hyperplay'
const origin = url.origin.startsWith('file://')
? 'file://hyperplay'
: url.origin
let domain = url.host
let origin = url.origin
// host is empty string and origin is null on the artifact
if (url.protocol === 'file:') {
domain = 'hyperplay'
origin = 'file://hyperplay'
}

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

2 comments on commit 7da58d7

@Fu6Na
Copy link

@Fu6Na Fu6Na commented on 7da58d7 Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

God

@Fu6Na
Copy link

@Fu6Na Fu6Na commented on 7da58d7 Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5h7t^

Please sign in to comment.