Skip to content

Commit 16538f0

Browse files
committed
keep authkeys around for 3 mins after auth
1 parent 53b7f83 commit 16538f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/wallet/wdk/src/sequence/handlers/identity.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export class IdentityHandler {
6767
})
6868

6969
authKey.identitySigner = res.signer
70+
authKey.expiresAt = new Date(Date.now() + 1000 * 60 * 3) // 3 minutes
7071
await this.authKeys.delBySigner('')
7172
await this.authKeys.set(authKey)
7273

@@ -80,7 +81,6 @@ export class IdentityHandler {
8081
address: signer.address,
8182
signature,
8283
})
83-
await this.authKeys.delBySigner(signer.address)
8484
}
8585

8686
protected async getAuthKeySigner(address: string): Promise<Identity.IdentitySigner | undefined> {
@@ -106,7 +106,7 @@ export class IdentityHandler {
106106
authKey = {
107107
address: Hex.fromBytes(new Uint8Array(publicKey)),
108108
identitySigner: '',
109-
expiresAt: new Date(Date.now() + 1000 * 60 * 3), // 3 minutes
109+
expiresAt: new Date(Date.now() + 1000 * 60 * 60), // 1 hour
110110
privateKey: keyPair.privateKey,
111111
}
112112
await this.authKeys.set(authKey)

0 commit comments

Comments
 (0)