MetaMask / MetaMask/metamask-mobile

Abstract authentication related business logic into Authentication service

Open
#14,260 0 comments 0 reactions 0 assignees View on GitHub
team-mobile-platform
Dominant language
TypeScript
Stars
3k
Forks
1.7k
Avg merge
1d 14h
Merged PRs (30d)
669

Description

### What is this about?

There are many flows that touch upon parts of authentication today in the mobile app. While much of the authentication logic is encapsulated in the Authentication service file, much of the logic still resides within the components themselves. For example, not only does `App.tsx` handle authentication logic, there is no reason for the auth logic to live there in the first place. Another area where auth related logic can be abstracted is the vault recovery flow that lives in the `Login/index.js` file. This pattern of lingering auth logic exists in a few other areas. So the purpose of this task is to abstract and consolidate all auth related logic into the `Authentication.ts` file. The areas where this is abstracted can then either use the `Authentication` service or remove the auth logic altogether if it's handled in an appropriate area.

### Scenario

_No response_

### Design

_No response_

### Technical Details

_No response_

### Threat Modeling Framework

_No response_

### Acceptance Criteria

_No response_

### Stakeholder review needed before the work gets merged

- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)

### References

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reading the Authentication.ts service, then inspect the authentication logic in App.tsx and the vault recovery flow in Login/index.js. Audit the other mobile authentication flows for similar logic. Done means auth-related behavior is consolidated in the Authentication service or removed from components where it is already handled appropriately.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native, typescript
Domain
authentication, mobile
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.