Skip to content

Commit

Permalink
Fix send signer address
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusx1211 committed Sep 29, 2023
1 parent 11d2f3c commit 789ce2a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/waas/src/sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ export class Sequence {
}
}

public async getSignerAddress() {
const signerPk = await this.signer.get()
if (!signerPk) {
throw new Error('No signer')
}

const signer = new ethers.Wallet(signerPk)
return signer.address
}

/**
* This method will initiate a sign-in process with the waas API. It must be performed
* when the user wants to sign in to the app, in parallel with the authentication of the
Expand Down Expand Up @@ -225,14 +235,14 @@ export class Sequence {
async validateSession(): Promise<Payload<ValidateSessionPacket>> {
const packet = {
code: 'validateSession',
session: await this.getWalletAddress()
session: await this.getSignerAddress()
} as ValidateSessionPacket

return this.buildPayload(packet)
}

async isSessionValid(): Promise<boolean> {
const sessionAddress = await this.getWalletAddress()
const sessionAddress = await this.getSignerAddress()
const guardClient = new Guard(this.guardUrl, fetch)

try {
Expand Down

0 comments on commit 789ce2a

Please sign in to comment.