Skip to content

feat/tc-layer+twitter+phone-otp-auth#158

Open
Frederick-88 wants to merge 11 commits into
feat/tc-layerfrom
feat/tc-layer+phone-otp-auth
Open

feat/tc-layer+twitter+phone-otp-auth#158
Frederick-88 wants to merge 11 commits into
feat/tc-layerfrom
feat/tc-layer+phone-otp-auth

Conversation

@Frederick-88

@Frederick-88 Frederick-88 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • SMS OTP authentication now available for secure wallet connection via phone verification
    • Twitter OAuth integration enables wallet access using Twitter credentials
    • Improved wallet connection with enhanced provider management and session persistence

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f7273ede-d104-420e-90e2-edaad9350f71

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tc-layer+phone-otp-auth

Comment @coderabbitai help to get the list of available commands and usage tips.

@Frederick-88 Frederick-88 changed the title Feat/tc layer+phone otp auth feat/tc-layer+phone-otp-auth Jun 8, 2026
@Frederick-88 Frederick-88 mentioned this pull request Jun 8, 2026
@Frederick-88 Frederick-88 changed the title feat/tc-layer+phone-otp-auth feat/tc-layer+twitter+phone-otp-auth Jun 8, 2026
@Frederick-88 Frederick-88 marked this pull request as ready for review June 8, 2026 10:09

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/store/wallet/turnkey.ts`:
- Around line 45-57: The SMS OTP flow in getSmsTurnkeyOTP leaves
walletStore.email unchanged which causes subsequent Magic lookups (in
submitTurnkeyOTP's Magic/email lookup block) to use a stale or empty email;
update getSmsTurnkeyOTP to either clear walletStore.email when initiating SMS
(call walletStore.$patch({ phone, email: '' })) or (preferably) modify
submitTurnkeyOTP to check the OTP channel (e.g., channel or similar flag stored
on walletStore) and only perform the Magic/email lookup when channel ===
'email'; reference getSmsTurnkeyOTP, submitTurnkeyOTP, walletStore.email and the
Magic lookup logic to implement the gating or clearing so SMS flows skip email
lookups.
- Around line 203-212: The code reads and JSON.parse's the 'tc_twitter_oauth'
localStorage entry and can throw on corrupt data, which bypasses the
WalletException retry flow and delays removal; wrap the JSON.parse call (the
logic that computes twitterSession/twitterOAuth and the derived nonce,
savedState, codeVerifier, targetPublicKey, expiresAt) in a try/catch, and on
parse failure immediately removeItem('tc_twitter_oauth') and return the same
"session not found" WalletException response as when the key is absent, ensuring
the bad entry is cleared before any early return so downstream validation cannot
proceed with malformed data.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1b83d150-a80a-490e-878a-0d5436b47a31

📥 Commits

Reviewing files that changed from the base of the PR and between 3993536 and 077a53e.

📒 Files selected for processing (5)
  • app/store/wallet/index.ts
  • app/store/wallet/turnkey.ts
  • app/utils/constant/index.ts
  • app/utils/constant/setup.ts
  • app/wallet/strategy.ts

Comment thread app/store/wallet/turnkey.ts
Comment thread app/store/wallet/turnkey.ts
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.

1 participant