feat: add new authentication flow
Description
This PR relates to the integration of new Authentication and User Storage controllers within the extension.
Specifically, the PR implements:
- Logic for integrating Redux with the created controllers
- Necessary hooks to manage actions and their associated loading and error states
- Integration with the onboarding process
- Integration with settings pages where necessary
At the end of the onboarding process, the user will be able to:
- Choose to use MetaMetrics
- Use the Profile Syncing feature (enabling UserStorage) or, through the advanced settings page, choose not to use this feature
If the user chooses to use MetaMetrics or enable Profile Syncing, the user must be authenticated.
Only if the user chooses not to use MetaMetrics and not to enable Profile Syncing can they remain unauthenticated.
Currently, the authentication process continues to use the locally created MetaMetrics ID.
The PR also includes components that allow the user, if they wish, to disable MetaMetrics or Profile Syncing at any time.
Related issues
Fixes:
Manual testing steps
- Follow the onboarding process
- Check the settings page to turn on/off metametrics and profile syncing
After
This is the new onboarding flow:
https://www.figma.com/file/c7GgNw2kScGrVyRGAPhwEd/Notifications?type=design&node-id=1498-68094&mode=design&t=sFvZbmQXNQaBxs6M-4
Pre-merge author checklist
- [x] I’ve followed MetaMask Coding Standards.
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using JSDoc format if applicable
- [x] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
Pre-merge reviewer checklist
- [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
- [x] 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.
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.
Codecov Report
Attention: Patch coverage is 89.05263% with 52 lines in your changes are missing coverage. Please review.
Project coverage is 67.06%. Comparing base (
d15001e) to head (851c7c7).
Additional details and impacted files
@@ Coverage Diff @@
## develop #24028 +/- ##
===========================================
- Coverage 67.43% 67.06% -0.37%
===========================================
Files 1286 1306 +20
Lines 50105 51137 +1032
Branches 12995 13134 +139
===========================================
+ Hits 33787 34292 +505
- Misses 16318 16845 +527
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Builds ready [ac4a516]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (775 ± 501 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 65 | 371 | 123 | 62 | 30 |
| domContentLoaded | 11 | 59 | 26 | 13 | 6 | ||
| load | 53 | 2531 | 775 | 1043 | 501 | ||
| domInteractive | 11 | 59 | 26 | 13 | 6 |
Bundle size diffs
- background: 0 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [3d5a90c]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (504 ± 504 ms)
| Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
|---|---|---|---|---|---|---|---|
| Chrome | Home | firstPaint | 59 | 163 | 87 | 24 | 11 |
| domContentLoaded | 9 | 36 | 14 | 7 | 3 | ||
| load | 47 | 3123 | 504 | 1051 | 504 | ||
| domInteractive | 9 | 36 | 14 | 7 | 3 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 38.44 KiB (1.17%)
- ui: 26.82 KiB (0.41%)
- common: 4.94 KiB (0.08%)