Skip to content

Commit 3c0b793

Browse files
committed
feat(ui): adding services.handleForceChangePassword
1 parent 27c8299 commit 3c0b793

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

.changeset/seven-flies-judge.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@aws-amplify/ui': minor
3+
---
4+
5+
Added services.handleForceChangePassword hook

packages/ui/src/machines/authenticator/actors/signIn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ export function signInActor({ services }: SignInMachineOptions) {
509509
options: { userAttributes },
510510
};
511511

512-
return confirmSignIn(input);
512+
return (services.handleForceChangePassword ?? confirmSignIn)(input);
513513
},
514514
signInWithRedirect(_, { data }) {
515515
return signInWithRedirect(data);

packages/ui/src/machines/authenticator/defaultServices.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export const defaultServices = {
111111
handleForgotPasswordSubmit: confirmResetPassword,
112112
handleForgotPassword: resetPassword,
113113
handleResendSignUpCode: resendSignUpCode,
114+
handleForceChangePassword: confirmSignIn,
114115

115116
// Validation hooks for overriding
116117
async validateCustomSignUp(

0 commit comments

Comments
 (0)