diff --git a/.changeset/soft-weeks-know.md b/.changeset/soft-weeks-know.md new file mode 100644 index 00000000000..059a62b4b43 --- /dev/null +++ b/.changeset/soft-weeks-know.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Always add URI to SIWE payload diff --git a/packages/thirdweb/src/auth/core/generate-login-payload.test.ts b/packages/thirdweb/src/auth/core/generate-login-payload.test.ts index cb271e25693..758cd54c4a6 100644 --- a/packages/thirdweb/src/auth/core/generate-login-payload.test.ts +++ b/packages/thirdweb/src/auth/core/generate-login-payload.test.ts @@ -89,7 +89,7 @@ describe("generateLoginPayload", () => { "issued_at": "1970-01-01T00:00:00.000Z", "resources": undefined, "statement": "Please ensure that the domain above matches the URL of the current website.", - "uri": undefined, + "uri": "example.com", "version": "1", } `); diff --git a/packages/thirdweb/src/auth/core/generate-login-payload.ts b/packages/thirdweb/src/auth/core/generate-login-payload.ts index c7690e50b93..1447823d1cb 100644 --- a/packages/thirdweb/src/auth/core/generate-login-payload.ts +++ b/packages/thirdweb/src/auth/core/generate-login-payload.ts @@ -46,7 +46,7 @@ export function generateLoginPayload(options: AuthOptions) { statement: options.login?.statement || DEFAULT_LOGIN_STATEMENT, version: options.login?.version || DEFAULT_LOGIN_VERSION, resources: options.login?.resources, - uri: options.login?.uri, + uri: options.login?.uri || options.domain, }; }; }