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: do not connect wallet from remember me in restricted geo #1124

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

rosepuppy
Copy link
Contributor

Check that geo is not blocked before trying to connect via stored signature

@rosepuppy rosepuppy requested a review from a team as a code owner October 4, 2024 20:50
Copy link

vercel bot commented Oct 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v4-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 8:52pm
v4-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 8:52pm

@@ -187,7 +191,7 @@ const useAccountsContext = () => {
log('useAccounts/decryptSignature', error);
dispatch(clearSavedEncryptedSignature());
}
} else if (sourceAccount.encryptedSignature) {
} else if (sourceAccount.encryptedSignature && geo && !blockedGeo) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you don't need the "&& geo"" part bcuz blockedGeo already accounts for it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some testing, and without "&& geo", the geo can be undefined initially which would cause !blockedGeo to be false, which would trigger this autoconnect before geo is fetched. so I added this.

I figure only down side is that autoconnect would not work if geo is not successfully fetched, but I would argue that we do not want to autoconnect if we couldn't not fetch for geo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm I wonder if the best solution here is to have isBlockedGeo return true if !geo 🤔 or would that lead to strange UI behavior

@rosepuppy rosepuppy merged commit 0cec083 into main Oct 4, 2024
9 checks passed
@rosepuppy rosepuppy deleted the compliance-remember-me branch October 4, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants