Skip to content

Commit

Permalink
Merge pull request #42 from wharfkit/identity-requests
Browse files Browse the repository at this point in the history
returning identityProof on login
  • Loading branch information
aaroncox authored Feb 16, 2024
2 parents 7d4f935 + d8b5d72 commit 79eef6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
AbstractWalletPlugin,
CallbackPayload,
Cancelable,
Canceled,
Checksum256,
LoginContext,
Logo,
Expand Down Expand Up @@ -144,6 +143,7 @@ export class WalletPluginAnchor extends AbstractWalletPlugin {
})

promptResponse.catch(() => {
// eslint-disable-next-line no-console
console.info('Modal closed')
})

Expand Down Expand Up @@ -175,12 +175,20 @@ export class WalletPluginAnchor extends AbstractWalletPlugin {
}
}

const resolvedResponse = await ResolvedSigningRequest.fromPayload(
callbackResponse,
context.esrOptions
)

const identityProof = resolvedResponse.getIdentityProof(callbackResponse.sig)

return {
chain: Checksum256.from(callbackResponse.cid),
permissionLevel: PermissionLevel.from({
actor: callbackResponse.sa,
permission: callbackResponse.sp,
}),
identityProof,
}
}

Expand Down

0 comments on commit 79eef6b

Please sign in to comment.