Skip to content

Commit

Permalink
Merge pull request #348 from Web3Auth/fix/allowed-origin-check
Browse files Browse the repository at this point in the history
Allow only auth service urls to set loginId
  • Loading branch information
chaitanyapotti authored Nov 10, 2024
2 parents edfd2e5 + 53e71c6 commit 71b33c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export class Auth {
sessionNamespace: this.options.sessionNamespace,
sessionTime: this.options.sessionTime,
sessionId,
allowedOrigin: this.options.sdkUrl,
});

if (this.options.network === WEB3AUTH_NETWORK.TESTNET || this.options.network === WEB3AUTH_NETWORK.SAPPHIRE_DEVNET) {
Expand Down Expand Up @@ -430,6 +431,7 @@ export class Auth {
sessionNamespace: data.options.sessionNamespace,
sessionTime: timeout, // each login key must be used with 10 mins (might be used at the end of popup redirect)
sessionId: loginId,
allowedOrigin: this.options.sdkUrl,
});

const promise = loginSessionMgr.createSession(JSON.parse(JSON.stringify(data)));
Expand Down

0 comments on commit 71b33c9

Please sign in to comment.