@aws-amplify/ui 6.10.0 → 6.10.1
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.
|
@@ -31,7 +31,11 @@ const shouldConfirmResetPassword = ({ step }) => step === 'CONFIRM_RESET_PASSWOR
|
|
|
31
31
|
const shouldConfirmSignUp = ({ step }) => step === 'CONFIRM_SIGN_UP';
|
|
32
32
|
// miscellaneous guards
|
|
33
33
|
const shouldVerifyAttribute = (_, { data }) => {
|
|
34
|
-
const { phone_number_verified, email_verified } = data;
|
|
34
|
+
const { email, phone_number, phone_number_verified, email_verified } = data;
|
|
35
|
+
// if neither email nor phone_number exist
|
|
36
|
+
// there is nothing to verify
|
|
37
|
+
if (!email && !phone_number)
|
|
38
|
+
return false;
|
|
35
39
|
// email/phone_verified is returned as a string
|
|
36
40
|
const emailNotVerified = email_verified === undefined || email_verified === 'false';
|
|
37
41
|
const phoneNotVerified = phone_number_verified === undefined || phone_number_verified === 'false';
|
package/dist/esm/utils/utils.mjs
CHANGED
|
@@ -184,7 +184,7 @@ const classNameModifierByFlag = (base, modifier, flag) => {
|
|
|
184
184
|
* @returns formatted string array
|
|
185
185
|
*/
|
|
186
186
|
function templateJoin(values, template) {
|
|
187
|
-
return values.reduce((acc, curr) => `${acc}${isString(curr) ? template(curr) : ''}`, '');
|
|
187
|
+
return values.reduce((acc, curr, index) => `${acc}${isString(curr) ? template(curr, index, values) : ''}`, '');
|
|
188
188
|
}
|
|
189
189
|
/**
|
|
190
190
|
* A function that does nothing
|
package/dist/index.js
CHANGED
|
@@ -290,7 +290,7 @@ const classNameModifierByFlag = (base, modifier, flag) => {
|
|
|
290
290
|
* @returns formatted string array
|
|
291
291
|
*/
|
|
292
292
|
function templateJoin(values, template) {
|
|
293
|
-
return values.reduce((acc, curr) => `${acc}${isString(curr) ? template(curr) : ''}`, '');
|
|
293
|
+
return values.reduce((acc, curr, index) => `${acc}${isString(curr) ? template(curr, index, values) : ''}`, '');
|
|
294
294
|
}
|
|
295
295
|
/**
|
|
296
296
|
* A function that does nothing
|
|
@@ -4259,7 +4259,11 @@ const shouldConfirmResetPassword = ({ step }) => step === 'CONFIRM_RESET_PASSWOR
|
|
|
4259
4259
|
const shouldConfirmSignUp = ({ step }) => step === 'CONFIRM_SIGN_UP';
|
|
4260
4260
|
// miscellaneous guards
|
|
4261
4261
|
const shouldVerifyAttribute = (_, { data }) => {
|
|
4262
|
-
const { phone_number_verified, email_verified } = data;
|
|
4262
|
+
const { email, phone_number, phone_number_verified, email_verified } = data;
|
|
4263
|
+
// if neither email nor phone_number exist
|
|
4264
|
+
// there is nothing to verify
|
|
4265
|
+
if (!email && !phone_number)
|
|
4266
|
+
return false;
|
|
4263
4267
|
// email/phone_verified is returned as a string
|
|
4264
4268
|
const emailNotVerified = email_verified === undefined || email_verified === 'false';
|
|
4265
4269
|
const phoneNotVerified = phone_number_verified === undefined || phone_number_verified === 'false';
|
|
@@ -127,7 +127,7 @@ export declare const classNameModifierByFlag: (base: string, modifier: Modifiers
|
|
|
127
127
|
* @param {(value: string) => string} template callback format param
|
|
128
128
|
* @returns formatted string array
|
|
129
129
|
*/
|
|
130
|
-
export declare function templateJoin(values: string[], template: (value: string) => string): string;
|
|
130
|
+
export declare function templateJoin(values: string[], template: (value: string, index: number, values: string[]) => string): string;
|
|
131
131
|
/**
|
|
132
132
|
* A function that does nothing
|
|
133
133
|
*
|