Repository navigation
Conversation
Expo restores the client from this snapshot when FAPI is unreachable at startup, so the field was lost on restore.
…is needs_client_trust
…th needs_client_trust
…e needs_client_trust
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 48d45e5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
API Changes Report
Summary
@clerk/sharedCurrent version: 4.44.1 Subpath
|
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
|



Description
Custom sign-in flows built on
SignInFuture(whatuseSignIn()returns in Core 3) can't read the Device Trust state of a sign-in. FAPI sendsclient_trust_stateand the legacySignInresource parses it, butSignInFuturedoesn't expose it. A customer asked for it so they can record, for each sign-in, whether Clerk recognized the device, and tell a trusted device apart from a sign-in that wasn't challenged.This PR adds
clientTrustState('new','known'or'pending') toSignInFuture, including through the@clerk/reactstate proxy. While the status isneeds_client_trust, it reads'new'even when FAPI leaves the field out, which FAPI does today for instances on that status. It'sundefinedwhen Device Trust is off, and before the first factor is verified. TheSignInsnapshot now keeps the field too, so Expo restores it when FAPI is unreachable at startup.https://github.com/clerk/clerk_go/pull/24016 makes FAPI return the field once the first factor is verified, in both Device Trust modes, and never before it. Until it ships, instances on the
needs_client_truststatus see'new'during the challenge andundefinedelsewhere. Merging this PR first is safe, but the JSDoc describes the behavior after the backend change, so the backend change should reach production first. The docs PR, https://github.com/clerk/clerk/pull/3821, updates the Device Trust guide and the legacySignInreference, and should merge after this change ships in a release.The prebuilt components don't change. They read the legacy
SignInfield, notSignInFuture. The new UI tests pin the "new device" notice. It renders once on each Device Trust screen whether or not FAPI sends the field, and stays hidden on the MFA screen.The value reflects the device as of the latest response. Completing a sign-in makes the device trusted in most cases, so a completed sign-in usually reads
'known', even right after a challenge. FAPI doesn't return the value before the first factor, so a flow can't read it aftercreate({ identifier }). That's deliberate: a value at that point would tell anyone who types an identifier whether that account has signed in on the browser. A flow reads it after the password, together with the status, which the docs PR explains.The JSDoc on
SignInFutureResource.clientTrustStateis new public docs, so please check the wording.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
✎