Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/seven-flies-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/ui': minor
---

Added services.handleForceChangePassword hook
3 changes: 1 addition & 2 deletions packages/ui/src/machines/authenticator/actors/signIn.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createMachine, sendUpdate } from 'xstate';
import type { ConfirmSignInInput } from 'aws-amplify/auth';
import {
confirmSignIn,
fetchUserAttributes,
resetPassword,
signInWithRedirect,
Expand Down Expand Up @@ -345,7 +344,7 @@ export function signInActor({ services }: SignInMachineOptions) {
options: { userAttributes },
};

return confirmSignIn(input);
return services.handleForceChangePassword(input);
},
signInWithRedirect(_, { data }) {
return signInWithRedirect(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const defaultServices = {
handleForgotPasswordSubmit: confirmResetPassword,
handleForgotPassword: resetPassword,
handleResendSignUpCode: resendSignUpCode,
handleForceChangePassword: confirmSignIn,

// Validation hooks for overriding
async validateCustomSignUp(
Expand Down