synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
20 lines • 1.15 kB
TypeScript
import { PasswordResetSignedToken } from '@sage-bionetworks/synapse-types';
export declare const TWO_FACTOR_AUTH_CHANGE_PASSWORD_PROMPT = "Two-factor authentication is required to change your password. Your password has not yet been changed.";
export type UseChangePasswordFormStateOptions = {
hideReset2FA?: boolean;
onChangePasswordSuccess?: () => void;
};
/**
* Hook that handles submitting a change password request and prompting the user for 2FA if necessary.
* @param options
*/
export default function useChangePasswordFormState(options?: UseChangePasswordFormStateOptions): {
successfullyChangedPassword: boolean;
isPending: boolean;
error: import("@sage-bionetworks/synapse-client").SynapseClientError | null;
promptForTwoFactorAuth: boolean;
TwoFactorAuthPrompt: () => import("react/jsx-runtime").JSX.Element;
handleChangePasswordWithCurrentPassword: (username: string, currentPassword: string, newPassword: string) => void;
handleChangePasswordWithResetToken: (newPassword: string, passwordChangeToken: PasswordResetSignedToken) => void;
};
//# sourceMappingURL=useChangePasswordFormState.d.ts.map