WIP: Wire up Mosaic Reverification - #9650
Draft
Ephem wants to merge 4 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 60cff5d The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types 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 |
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR wires up the Mosaic Reverification logic.
/featuresfolder/blocksare already meant to also include logic? If so I'll move it back, I moved it because everything in there seems to be pure UI right now, but might just be because we haven't wired things up yet.useReverificationWithStatehook - Simple wrapper arounduseReverificationas per the custom UI part of the useReverification docspasskeyif webAuthn is not accessible etccontroller.status- The overall status -idle,unavailable,loading,ready- Represents "full card states"ready-controller.steprepresents which part of the flow we are in,method-picker,passwordetccontroller.isPending- Progress state for the current card, if status if a full page loading state, this is a inline spinnerThe way this works is:
const [deleteAction, reverificationState] = useReverificationWithState(deleteMutation);deleteActionis called, and the API responds that it needs reverification,reverificationState.isActivegoestrue<Reverification {...reverificationState}>- This will drive the process and when resolved:reverificationState.isActiveis going to gofalseagaindeleteMutationgets retriedSo if you pass that
deleteActioninto another machine, when it gets called and needs reverification, it's going to stay pending until resolved. That means we can render<Reverification>inside another flow, without that machine having to know about it.I'll try to stack a PR on top of this to showcase how it can be used, and to make testing easier. I'm sure there might be some tweaks we want to make around how this interacts with other UI etc.
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change