Skip to content

Commit

Permalink
chore(clerk-js): Clean up props for SignInFactorOnePassword (#4032)
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef authored Aug 27, 2024
1 parent 6428493 commit b20e28b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .changeset/slimy-students-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
11 changes: 1 addition & 10 deletions packages/clerk-js/src/ui/components/SignIn/SignInFactorOne.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ResetPasswordCodeFactor, SignInFactor } from '@clerk/types';
import type { SignInFactor } from '@clerk/types';
import React from 'react';

import { withRedirectToAfterSignIn } from '../../common';
Expand Down Expand Up @@ -134,15 +134,6 @@ export function _SignInFactorOne(): JSX.Element {
case 'password':
return (
<SignInFactorOnePasswordCard
onFactorPrepare={(factor: ResetPasswordCodeFactor) => {
handleFactorPrepare();
setFactor(prev => ({
currentFactor: {
...factor,
},
prevCurrentFactor: prev.currentFactor,
}));
}}
onForgotPasswordMethodClick={resetPasswordFactor ? toggleForgotPasswordStrategies : toggleAllStrategies}
onShowAlternativeMethodsClick={toggleAllStrategies}
onPasswordPwned={() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isPasswordPwnedError, isUserLockedError } from '@clerk/shared/error';
import { useClerk } from '@clerk/shared/react';
import type { ResetPasswordCodeFactor } from '@clerk/types';
import React from 'react';

import { clerkInvalidFAPIResponse } from '../../../core/errors';
Expand All @@ -16,7 +15,6 @@ import { useResetPasswordFactor } from './useResetPasswordFactor';
type SignInFactorOnePasswordProps = {
onForgotPasswordMethodClick: React.MouseEventHandler | undefined;
onShowAlternativeMethodsClick: React.MouseEventHandler | undefined;
onFactorPrepare: (f: ResetPasswordCodeFactor) => void;
onPasswordPwned?: () => void;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export function _SignInFactorTwo(): JSX.Element {
const [showAllStrategies, setShowAllStrategies] = React.useState<boolean>(!currentFactor);
const toggleAllStrategies = () => setShowAllStrategies(s => !s);

// TODO
const handleFactorPrepare = () => {
lastPreparedFactorKeyRef.current = factorKey(currentFactor);
};
Expand Down

0 comments on commit b20e28b

Please sign in to comment.