Skip to content

Conversation

@bfullam
Copy link
Contributor

@bfullam bfullam commented Oct 1, 2025

Description

Problem
Developers must manually enter their wallet password every time they restart the app during development, which slows down the development workflow. This repetitive task becomes particularly tedious when testing features that require frequent app restarts or when switching between different testing scenarios. The current authentication flow doesn't provide any shortcuts for development environments.

Solution
Added a development-only auto-login feature that reads a password from the MM_DEV_AUTO_LOGIN_PASSWORD environment variable and automatically authenticates the user on app launch. The feature includes proper error handling to fall back to the normal login flow if auto-login fails. Developers can now configure their password once in .js.env and bypass the login screen, significantly speeding up the development cycle.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Adds dev-only auto-login using MM_DEV_AUTO_LOGIN_PASSWORD, updates auth flow, tests, and env example.

  • App Auth Flow (app/components/Nav/App/App.tsx):
    • Adds development-only auto-login: if NODE_ENV=development and MM_DEV_AUTO_LOGIN_PASSWORD is set, calls Authentication.userEntryAuth with password and currentAuthType of password, then navigates to Routes.ONBOARDING.HOME_NAV; falls back to normal auth on failure.
    • Imports AuthData and AUTHENTICATION_TYPE to support the new path.
  • Tests (app/components/Nav/App/App.test.tsx):
    • Mocks Authentication.userEntryAuth and adds tests to ensure auto-login is skipped in production and when no password is set; includes a skipped test for successful auto-login.
  • Config (.js.env.example):
    • Adds MM_DEV_AUTO_LOGIN_PASSWORD (development only) with documentation comments.

Written by Cursor Bugbot for commit 247bbea. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2025

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.

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Oct 1, 2025
@github-actions github-actions bot added the size-S label Oct 1, 2025
cursor[bot]

This comment was marked as outdated.

@github-actions github-actions bot added size-M and removed size-S labels Oct 1, 2025

// Try dev auto-login first
const isDevelopment = process.env.NODE_ENV === 'development';
const autoLoginPassword = process.env.MM_DEV_AUTO_LOGIN_PASSWORD;
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if we would want to reuse the already password env variable that it's defined!

This is something really cool! I will scheduled a 15 minute meeting around this, because maybe this is useful to save time on our e2e pipelines <3

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
35.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@github-actions
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

@github-actions github-actions bot added the stale Issues that have not had activity in the last 90 days label Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size-M stale Issues that have not had activity in the last 90 days team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants