Skip to content

Commit

Permalink
Return an error if user rejects signing message to log in
Browse files Browse the repository at this point in the history
  • Loading branch information
ccali11 committed Oct 10, 2023
1 parent feda4c4 commit 5a28d9b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/web/src/components/ConnectWalletsFlow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import useTrezor from '@/composables/trezor'
import useUser from '@/composables/user'
import useWalletConnect from '@/composables/walletConnectV2'
type UserAuthFlowState = 'select_provider' | 'select_address' | 'loading' | 'success' | 'add_account' | 'confirm_signage_with_existing_secondary'
type UserAuthFlowState = 'select_provider' | 'select_address' | 'loading' | 'success' | 'add_account' | 'confirm_signage_with_existing_secondary' | 'Error in userAuthState'
const supportedWalletProviders = [
'MetaMask',
Expand Down Expand Up @@ -108,7 +108,7 @@ async function selectAddress(address: string, pathIndex: number): Promise<void>
errorMessage.value = true
errorMassageText.value = 'Something went wrong, please try again later.'
}
console.log('loging response => handle animnation here:', response)
console.log('logging response => handle animnation here:', response)
}
/**
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/composables/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ export default function useAuth() {
return 'Selected address is not active address in wallet'
}
} else {
alert('Login not yet supported for this wallet provider')
return 'Error in userAuthState'
}
}
Expand Down Expand Up @@ -270,7 +269,6 @@ export default function useAuth() {
*/
async function loginWithProvider(loginCredentials: LoginCredentials) {
const { provider } = loginCredentials
console.log('loginCredentials in loginWithProvider :>> ', loginCredentials)
try {
if (ethersProviderList.includes(provider)) {
await loginWithEthers(loginCredentials)
Expand Down
1 change: 0 additions & 1 deletion apps/web/src/composables/ethers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ export default function useEthers() {

async function loginWithEthers(loginCredentials: LoginCredentials): Promise<void>{
const { provider, address, currency } = loginCredentials
console.log('address in loginWithEthers :>> ', address)
const browserProvider = getBrowserProvider(provider)
const web3Provider: ethers.providers.Web3Provider = new ethers.providers.Web3Provider(browserProvider as EthersProvider)
try {
Expand Down

0 comments on commit 5a28d9b

Please sign in to comment.