feat(onboarding): add Telegram OAuth login for seedless onboarding#29465
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
…ytics - Suppress generic error sheet on TelegramLoginError (matches google/apple) - Include oauth_error_code on SOCIAL_LOGIN_FAILED for all providers - Remove debug Alert and verbose Logger calls from TelegramLoginHandler
- Pass profile_pairing_token (hydra access_token) through AuthResponse → authenticate() - New useProfilePairing hook firing pairProfileServiceWithSocialLogin from useIdentityEffects - Selectors for profilePairingToken + status (now per-SRP under socialBackupsMetadata[0]) - Wire profilePairingEndpoint + fetchFunction into SeedlessOnboardingController init - Bump @metamask/seedless-onboarding-controller to preview 9.1.0-preview-95a687acf NOTE: dev creds set to 'mm-telegram-dev-tyler' for local testing — revert before ready-for-review. PAIR-DEBUG console logs are temporary and should be stripped.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 244142f. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: SmokeSeedlessOnboarding (primary): The core changes directly affect the seedless onboarding infrastructure:
SmokeAccounts: SmokeWalletPlatform: The Not selected:
Performance Test Selection: |
|
andrepimenta
left a comment
There was a problem hiding this comment.
Approved for mobile platform owned files




Description
TLDR: Adds Telegram as a third OAuth provider (alongside Google and Apple) for seedless onboarding, behind the existing onboarding flow surfaces.
This wires a new
TelegramLoginHandlerinto the existingOAuthServiceinfrastructure. The flow is backend-mediated:/api/v2/telegram/login/initiateendpoint with a PKCE code challenge./api/v2/telegram/login/verifywith the code verifier, exchanges the resulting OIDC token through Hydra's JWT-bearer grant, and mints the standard auth-service token set used by seedless onboarding.Telegram entries have been added to
OAUTH_CONFIGfor every build type (development, main_, flask_) and platform (Android/iOS), and Telegram is exposed in theOnboarding,OnboardingSheet, andWalletRecoveryviews.Architecture and bot-management notes are captured in
docs/frontend-telegram-integration-architecture.md,docs/telegram-oidc-bot-creation-management.md, anddocs/auth-backend-consolidation-strategy.md.Jira: https://consensyssoftware.atlassian.net/browse/TO-738, https://consensyssoftware.atlassian.net/browse/TO-751
Changelog
CHANGELOG entry: Added Telegram as a login option for seedless onboarding.
Related issues
Fixes:
Manual testing steps
```gherkin
Feature: Telegram OAuth onboarding
Scenario: New user creates a wallet via Telegram
Given the app is freshly installed
And the user is on the Onboarding screen
Scenario: Returning user recovers a wallet via Telegram
Given a wallet was previously created with Telegram
And the app is freshly installed
When the user taps "Continue with Telegram" on the WalletRecovery screen
And completes Telegram authentication
Then the existing wallet is rehydrated
Scenario: User cancels the Telegram auth session
Given the user is on the Onboarding screen
When the user taps "Continue with Telegram"
And dismisses the in-app browser
Then the app remains on the Onboarding screen with no error
```
Test on both Android and iOS — Android required a session-persistence fix (commit `bce106c633`).
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Note
High Risk
High risk because it extends seedless onboarding authentication/token flows with a new Telegram provider, new redirect/exchange logic, and updated client ID handling that could impact login, token refresh, and account identity data.
Overview
Adds Telegram as a third OAuth provider for seedless onboarding, gated by a new remote feature flag
telegram_login_enabled(with env override) and surfaced in the onboarding bottom sheet when enabled.Implements a new
TelegramLoginHandlerand extends the OAuth factory/config/constants to support Telegram-specific redirect URIs, connection IDs, and a backend-mediated verify → Hydra token exchange → mint flow; token refresh logic is updated to use Telegram’s platform-specific client IDs and the OAuth pipeline now derives{userId, accountName}vialoginHandler.getUserInfo()(including Telegram-providedaccount_name).Updates onboarding/recovery UI and analytics to recognize Telegram accounts (new
AccountTypevariants, Telegram-specific copy, icon/styling), adds registry/CI flag constant wiring, and adjusts several UI tests/snapshots to assert loading viaaccessibilityState.busyinstead of aspinner-containertest id.Reviewed by Cursor Bugbot for commit 6bd5282. Bugbot is set up for automated code reviews on this repo. Configure here.