-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat(card): move Card authentication verification out of CardSDK context #21399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…/card-api-integration-foundation
…taMask/metamask-mobile into chore/card-api-integration-foundation
…/card-api-integration-foundation
…/card-api-integration-foundation
…card-authenticated-info
…and remaining allowance values
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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21399 +/- ##
==========================================
+ Coverage 77.11% 77.21% +0.10%
==========================================
Files 3615 3641 +26
Lines 89144 89498 +354
Branches 16861 16947 +86
==========================================
+ Hits 68745 69108 +363
+ Misses 15721 15709 -12
- Partials 4678 4681 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Missing release label release-7.58.0 on PR. Adding release label release-7.58.0 on PR and removing other release labels(release-7.59.0), as PR was added to branch 7.58.0 when release was cut. |
To be merged after #21390
Description
This PR moves the Card authentication verification logic out of the CardSDK context.
With this change, the app can determine whether a user is authenticated with Card even before they open the Card screen.
This enables us to:
Changelog
CHANGELOG entry: Refactored Card authentication to enable pre-screen checks
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Moves Card auth verification out of the SDK context into app-level hooks/thunks, adds token refresh/storage utilities, updates SDK and Redux state/selectors for auth and user location.
useCardAuthenticationVerification
hook dispatchesverifyCardAuthentication
on login/flag changes.CardVerification
now invokes bothuseCardholderCheck
anduseCardAuthenticationVerification
.verifyCardAuthentication
thunk; new stateisAuthenticated
flow anduserCardLocation
with selectors/actions (selectIsAuthenticatedCard
,selectUserCardLocation
,setUserCardLocation
).handleLocalAuthentication
,refreshCardToken
.cardTokenVault
now storesaccessTokenExpiresAt
/refreshTokenExpiresAt
(ms conversion), validates data, and returnsnull
when absent.CardSDK
):userCardLocation
; auto-setsx-us-env
header internally; removed per-calllocation
params andrefreshLocalToken
.CardSDKProvider
simplified to SDK init only; logout clears auth state.useCardProviderAuthentication
stores new token fields and dispatchessetUserCardLocation
.lastFetched
and a token; effect early-returns consolidated.loading
.Written by Cursor Bugbot for commit 175a2a4. This will update automatically on new commits. Configure here.