Skip to content

Commit 161aeb2

Browse files
authored
Migrate to @signinwithethereum/siwe (#1074)
* chore: migrate @magic-ext/siwe to @signinwithethereum/siwe Replace the legacy "siwe" dependency with "@signinwithethereum/siwe"@^4.1.0 for the @magic-ext/siwe package and update source imports accordingly. Updated packages/@magic-ext/siwe/package.json to use the new package and changed the SiweMessage import in src/index.ts. yarn.lock was regenerated to capture the new dependency resolution. * Include issuedAt timestamp in SIWE message Add an issuedAt field to the SIWE message payload set to the current time (new Date().toISOString()). This ensures generated SIWE messages include the issuance timestamp (per EIP-4361 expectations), aiding verification and time-based checks.
1 parent 9cb2480 commit 161aeb2

3 files changed

Lines changed: 81 additions & 108 deletions

File tree

packages/@magic-ext/siwe/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
]
2929
},
3030
"dependencies": {
31-
"siwe": "^3.0.0"
31+
"@signinwithethereum/siwe": "^4.1.0"
3232
},
3333
"peerDependencies": {
3434
"ethers": "^6.0.0"

packages/@magic-ext/siwe/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Extension } from '@magic-sdk/provider';
2-
import { SiweMessage } from 'siwe';
2+
import { SiweMessage } from '@signinwithethereum/siwe';
33
import { SiwePayloadMethod, SiweGenerateNonceParams, SiweGenerateMessageParams, SiweLoginParams } from './types';
44

55
export class SiweExtension extends Extension.Internal<'siwe'> {
@@ -27,6 +27,7 @@ export class SiweExtension extends Extension.Internal<'siwe'> {
2727
version: '1',
2828
chainId: params.chainId || 1,
2929
nonce,
30+
issuedAt: new Date().toISOString(),
3031
});
3132

3233
return siweMessage.prepareMessage();

0 commit comments

Comments
 (0)