Skip to content

fix(elements): Correct TS types for verification machine - #3671

Merged
LekoArts merged 5 commits into
mainfrom
lekoarts/sdk-1845-correct-ts-types-for-strategy-verification-machine
Jul 9, 2024
Merged

fix(elements): Correct TS types for verification machine#3671
LekoArts merged 5 commits into
mainfrom
lekoarts/sdk-1845-correct-ts-types-for-strategy-verification-machine

Conversation

@LekoArts

@LekoArts LekoArts commented Jul 8, 2024

Copy link
Copy Markdown
Contributor

Description

Inside our verification machine we had a bunch of as unknown as SignInFactor assertions and other inaccurate TS types. This PR fixes it 👍 See inline comments for more context.

Fixes SDK-1845

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented Jul 8, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e0e2dff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When 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

// https://www.notion.so/clerkdev/Implement-sign-in-alt-methods-e6e60ffb644645b3a0553b50556468ce
export function determineStartingSignInFactor(
firstFactors: SignInFactor[],
firstFactors: SignInFirstFactor[],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SignInFactor is SignInFirstFactor | SignInSecondFactor. The changes in this file narrow the input and return types

loadingStep: 'verifications',
parent: input.parent,
registeredStrategies: new Set<SignInFactor>(),
registeredStrategies: new Set<SignInStrategyName>(),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change stems from looking at packages/elements/src/react/sign-in/verifications.tsx and checking what is actually passed

@LekoArts
LekoArts marked this pull request as ready for review July 8, 2024 14:08
@LekoArts
LekoArts enabled auto-merge (squash) July 9, 2024 06:06
@LekoArts
LekoArts merged commit bb3c625 into main Jul 9, 2024
@LekoArts
LekoArts deleted the lekoarts/sdk-1845-correct-ts-types-for-strategy-verification-machine branch July 9, 2024 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants