Skip to content

Commit 8119bcd

Browse files
committed
feat(ui): adding services.handleForceChangePassword
1 parent b033a73 commit 8119bcd

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { createMachine, sendUpdate } from 'xstate';
22
import type { ConfirmSignInInput } from 'aws-amplify/auth';
33
import {
4-
confirmSignIn,
54
fetchUserAttributes,
65
resetPassword,
76
signInWithRedirect,
@@ -345,7 +344,7 @@ export function signInActor({ services }: SignInMachineOptions) {
345344
options: { userAttributes },
346345
};
347346

348-
return confirmSignIn(input);
347+
return services.handleForceChangePassword(input);
349348
},
350349
signInWithRedirect(_, { data }) {
351350
return signInWithRedirect(data);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export const defaultServices = {
9292
handleForgotPasswordSubmit: confirmResetPassword,
9393
handleForgotPassword: resetPassword,
9494
handleResendSignUpCode: resendSignUpCode,
95+
handleForceChangePassword: confirmSignIn,
9596

9697
// Validation hooks for overriding
9798
async validateCustomSignUp(

0 commit comments

Comments
 (0)