diff --git a/lib/build/emailpassword-shared4.js b/lib/build/emailpassword-shared4.js index e3070936a..2bcac4ce7 100644 --- a/lib/build/emailpassword-shared4.js +++ b/lib/build/emailpassword-shared4.js @@ -275,6 +275,7 @@ function getDefaultPasswordFormField() { }; } function normaliseResetPasswordUsingTokenFeature(signUpPasswordFieldValidate, signUpEmailField, config) { + var _a; if (config === undefined) { config = {}; } @@ -313,7 +314,13 @@ function normaliseResetPasswordUsingTokenFeature(signUpPasswordFieldValidate, si formFields: [ genericComponentOverrideContext.__assign( genericComponentOverrideContext.__assign({}, getDefaultEmailFormField()), - { validate: signUpEmailField.validate, placeholder: "", autofocus: true } + { + validate: signUpEmailField.validate, + placeholder: "", + autofocus: true, + getDefaultValue: + (_a = config.enterEmailForm) === null || _a === void 0 ? void 0 : _a.getDefaultValue, + } ), ], }; diff --git a/lib/build/recipe/emailpassword/types.d.ts b/lib/build/recipe/emailpassword/types.d.ts index d1cb6e9ea..b87dbee45 100644 --- a/lib/build/recipe/emailpassword/types.d.ts +++ b/lib/build/recipe/emailpassword/types.d.ts @@ -100,7 +100,9 @@ export declare type FormFieldSignInConfig = FormFieldBaseConfig; export declare type ResetPasswordUsingTokenUserInput = { disableDefaultUI?: boolean; submitNewPasswordForm?: FeatureBaseConfig; - enterEmailForm?: FeatureBaseConfig; + enterEmailForm?: FeatureBaseConfig & { + getDefaultValue?: () => string; + }; }; export declare type NormalisedResetPasswordUsingTokenFeatureConfig = { disableDefaultUI: boolean; diff --git a/lib/ts/recipe/emailpassword/types.ts b/lib/ts/recipe/emailpassword/types.ts index 5ffe5b3d1..d65b31dd5 100644 --- a/lib/ts/recipe/emailpassword/types.ts +++ b/lib/ts/recipe/emailpassword/types.ts @@ -198,7 +198,9 @@ export type ResetPasswordUsingTokenUserInput = { /* * enterEmailForm config. */ - enterEmailForm?: FeatureBaseConfig; + enterEmailForm?: FeatureBaseConfig & { + getDefaultValue?: () => string; + }; }; export type NormalisedResetPasswordUsingTokenFeatureConfig = { diff --git a/lib/ts/recipe/emailpassword/utils.ts b/lib/ts/recipe/emailpassword/utils.ts index 6220af0c5..97b96625e 100644 --- a/lib/ts/recipe/emailpassword/utils.ts +++ b/lib/ts/recipe/emailpassword/utils.ts @@ -266,6 +266,7 @@ export function normaliseResetPasswordUsingTokenFeature( validate: signUpEmailField.validate, placeholder: "", autofocus: true, + getDefaultValue: config.enterEmailForm?.getDefaultValue, }, ], };