@aws-amplify/ui-react 6.15.3 → 6.15.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,13 +7,19 @@ import { isOtpChallenge } from '../utils.mjs';
7
7
 
8
8
  const { getConfirmText, getConfirmingText, getBackToSignInText, getResendCodeText, } = authenticatorTextUtil;
9
9
  const ConfirmSignInFooter = () => {
10
- const { isPending, toSignIn, challengeName, resendCode } = useAuthenticator((context) => [
10
+ const { isPending, toSignIn, challengeName, resendCode, selectedAuthMethod, availableAuthMethods, } = useAuthenticator((context) => [
11
11
  context.isPending,
12
12
  context.toSignIn,
13
13
  context.challengeName,
14
14
  context.resendCode,
15
+ context.selectedAuthMethod,
16
+ context.availableAuthMethods,
15
17
  ]);
16
- const showResendCode = isOtpChallenge(challengeName) && resendCode;
18
+ // Only show "Resend Code" for passwordless (USER_AUTH) flows.
19
+ // Password-based sign-in does not support resending MFA codes.
20
+ const hasPasswordlessMethod = (!!selectedAuthMethod && selectedAuthMethod !== 'PASSWORD') ||
21
+ !!availableAuthMethods?.some((m) => m !== 'PASSWORD');
22
+ const showResendCode = isOtpChallenge(challengeName) && hasPasswordlessMethod && resendCode;
17
23
  return (React__default.createElement(Flex, { direction: "column" },
18
24
  React__default.createElement(Button, { isDisabled: isPending, type: "submit", variation: "primary", isLoading: isPending, loadingText: getConfirmingText() }, getConfirmText()),
19
25
  showResendCode && (React__default.createElement(Button, { onClick: resendCode, type: "button" }, getResendCodeText())),
@@ -1,3 +1,3 @@
1
- const VERSION = '6.15.3';
1
+ const VERSION = '6.15.4';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -2463,7 +2463,7 @@ const defaultDeleteUserDisplayText = {
2463
2463
  warningText: 'Deleting your account is not reversible. You will lose access to your account and all data associated with it.',
2464
2464
  };
2465
2465
 
2466
- const VERSION = '6.15.3';
2466
+ const VERSION = '6.15.4';
2467
2467
 
2468
2468
  const logger$2 = ui.getLogger('AccountSettings');
2469
2469
  const getIsDisabled = (formValues, validationError) => {
@@ -2886,13 +2886,19 @@ const isOtpChallenge = (challengeName) => !!challengeName &&
2886
2886
 
2887
2887
  const { getConfirmText, getConfirmingText, getBackToSignInText: getBackToSignInText$2, getResendCodeText: getResendCodeText$1, } = ui.authenticatorTextUtil;
2888
2888
  const ConfirmSignInFooter = () => {
2889
- const { isPending, toSignIn, challengeName, resendCode } = uiReactCore.useAuthenticator((context) => [
2889
+ const { isPending, toSignIn, challengeName, resendCode, selectedAuthMethod, availableAuthMethods, } = uiReactCore.useAuthenticator((context) => [
2890
2890
  context.isPending,
2891
2891
  context.toSignIn,
2892
2892
  context.challengeName,
2893
2893
  context.resendCode,
2894
+ context.selectedAuthMethod,
2895
+ context.availableAuthMethods,
2894
2896
  ]);
2895
- const showResendCode = isOtpChallenge(challengeName) && resendCode;
2897
+ // Only show "Resend Code" for passwordless (USER_AUTH) flows.
2898
+ // Password-based sign-in does not support resending MFA codes.
2899
+ const hasPasswordlessMethod = (!!selectedAuthMethod && selectedAuthMethod !== 'PASSWORD') ||
2900
+ !!availableAuthMethods?.some((m) => m !== 'PASSWORD');
2901
+ const showResendCode = isOtpChallenge(challengeName) && hasPasswordlessMethod && resendCode;
2896
2902
  return (React__namespace["default"].createElement(Field.Flex, { direction: "column" },
2897
2903
  React__namespace["default"].createElement(Field.Button, { isDisabled: isPending, type: "submit", variation: "primary", isLoading: isPending, loadingText: getConfirmingText() }, getConfirmText()),
2898
2904
  showResendCode && (React__namespace["default"].createElement(Field.Button, { onClick: resendCode, type: "button" }, getResendCodeText$1())),
@@ -1 +1 @@
1
- export declare const VERSION = "6.15.3";
1
+ export declare const VERSION = "6.15.4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react",
3
- "version": "6.15.3",
3
+ "version": "6.15.4",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -56,8 +56,8 @@
56
56
  "typecheck": "tsc --noEmit"
57
57
  },
58
58
  "dependencies": {
59
- "@aws-amplify/ui": "6.15.3",
60
- "@aws-amplify/ui-react-core": "3.6.3",
59
+ "@aws-amplify/ui": "6.15.4",
60
+ "@aws-amplify/ui-react-core": "3.6.4",
61
61
  "@radix-ui/react-direction": "^1.1.0",
62
62
  "@radix-ui/react-dropdown-menu": "^2.1.10",
63
63
  "@radix-ui/react-slider": "^1.3.2",