Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sign modal not appearing when going through siwe flow #2213

Merged
merged 13 commits into from
May 7, 2024
Merged
8 changes: 7 additions & 1 deletion packages/siwe/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import {
AccountController,
NetworkController,
ConnectionController,
RouterUtil
RouterUtil,
StorageUtil,
RouterController
} from '@web3modal/core'

import { NetworkUtil } from '@web3modal/common'
Expand Down Expand Up @@ -91,6 +93,10 @@ export class Web3ModalSIWEClient {
throw new Error('A chainId is required to create a SIWE message.')
}
const message = this.methods.createMessage({ address, nonce, chainId })
const type = StorageUtil.getConnectedConnector()
if (type === 'EMAIL') {
RouterController.push('ApproveTransaction')
}
const signature = await ConnectionController.signMessage(message)
const isValid = await this.methods.verifyMessage({ message, signature })
if (!isValid) {
Expand Down
Loading