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: cloudauth siwx address match #3670

Merged
merged 4 commits into from
Jan 20, 2025
Merged

Conversation

tomiir
Copy link
Collaborator

@tomiir tomiir commented Jan 16, 2025

Description

Fixes issue where a non-cased address response from a wallet would cause 1CA to fail on CloudAuthSIWX

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

changeset-bot bot commented Jan 16, 2025

🦋 Changeset detected

Latest commit: 38570a8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 19 packages
Name Type
@reown/appkit-siwx Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 16, 2025

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

Name Status Preview Comments Updated (UTC)
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 9:16am
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 9:16am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-vue-solana ⬜️ Ignored (Inspect) Jan 20, 2025 9:16am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Jan 20, 2025 9:16am
vue-wagmi-example ⬜️ Ignored (Inspect) Jan 20, 2025 9:16am

Copy link
Contributor

github-actions bot commented Jan 16, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 68.47% 19481 / 28449
🔵 Statements 68.47% 19481 / 28449
🔵 Functions 59.12% 1697 / 2870
🔵 Branches 79.67% 3422 / 4295
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/siwx/src/configs/CloudAuthSIWX.ts 100% 100% 100% 100%
Generated in workflow #9012 for commit 38570a8 by the Vitest Coverage Report Action

@tomiir tomiir changed the title Fix/cloudauth siwx address match fix: cloudauth siwx address match Jan 16, 2025
@@ -72,7 +72,10 @@ export class CloudAuthSIWX implements SIWXConfig {

const siweCaipNetworkId = `eip155:${siweSession?.chainId}`

if (!siweSession || siweCaipNetworkId !== chainId || siweSession.address !== address) {
const isSameAddress = siweSession?.address.toLowerCase() === address.toLowerCase()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use HelpersUtil.isLowerCaseMatch ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -72,7 +72,10 @@ export class CloudAuthSIWX implements SIWXConfig {

const siweCaipNetworkId = `eip155:${siweSession?.chainId}`
Copy link
Contributor

Choose a reason for hiding this comment

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

@tomiir I remember we've been checking this code piece together and refactored xd Not sure if it's broken later or we introduced an issue

Copy link
Collaborator

@Cali93 Cali93 left a comment

Choose a reason for hiding this comment

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

Thanks 🙏

@tomiir tomiir merged commit 25a97c6 into main Jan 20, 2025
19 checks passed
@tomiir tomiir deleted the fix/cloudauth-siwx-address-match branch January 20, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants