Skip to content

Commit

Permalink
fix(authenticator): forgot password clean up (#4767)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebpollman committed Nov 17, 2023
1 parent 1e79fc3 commit 4ff26e2
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 11 deletions.
9 changes: 9 additions & 0 deletions .changeset/early-sheep-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@aws-amplify/ui-react-native": patch
"@aws-amplify/ui-react": patch
"@aws-amplify/ui": patch
"@aws-amplify/ui-vue": patch
"@aws-amplify/ui-angular": patch
---

fix(authenticator): forgot password clean up
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const { getResetYourPasswordText, getSendCodeText, getBackToSignInText } =
templateUrl: './forgot-password.component.html',
})
export class ForgotPasswordComponent {
@HostBinding('attr.data-amplify-authenticator-forgotPassword') dataAttr = '';
@HostBinding('attr.data-amplify-authenticator-forgotpassword') dataAttr = '';
@Input() public headerText = getResetYourPasswordText();

// translated texts
Expand Down
6 changes: 3 additions & 3 deletions packages/react-native/src/Authenticator/Defaults/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface ConfirmSignInStyle {}
export interface ConfirmSignUpStyle {}
export interface ConfirmVerifyUserStyle {}
export interface ForceNewPasswordStyle {}
export interface ResetPasswordStyle {}
export interface ForgotPasswordStyle {}
export interface SetupTotpStyle {}
export interface SignInStyle {}
export interface SignUpStyle {}
Expand Down Expand Up @@ -59,7 +59,7 @@ export type DefaultForceNewPasswordProps = React.ComponentPropsWithoutRef<
export type DefaultForgotPasswordProps = React.ComponentPropsWithoutRef<
DefaultComponents<
TextFieldOptionsType,
{ style?: ResetPasswordStyle }
{ style?: ForgotPasswordStyle }
>['ForgotPassword']
>;

Expand Down Expand Up @@ -120,7 +120,7 @@ type ForceNewPasswordComponent<P = {}> = OverrideComponents<

type ForgotPasswordComponent<P = {}> = OverrideComponents<
TextFieldOptionsType,
{ style?: ResetPasswordStyle } & P
{ style?: ForgotPasswordStyle } & P
>['ForgotPassword'];

type SetupTotpComponent<P = {}> = OverrideComponents<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const ForgotPassword = ({
<RouteContainer className={className} variation={variation}>
<form
data-amplify-form=""
data-amplify-authenticator-Forgotpassword=""
data-amplify-authenticator-forgotpassword=""
method="post"
onChange={handleChange}
onSubmit={handleSubmit}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/helpers/authenticator/textUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const authenticatorTextUtil = {
/** ConfirmSignIn */
getChallengeText,

/** ResetPassword */
/** ForgotPassword */
getResetYourPasswordText: () => translate(DefaultTexts.RESET_PASSWORD),

/** SetupTotp */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ exports[`authenticator renders forgotPassword subcomponent 1`] = `
<form
data-amplify-authenticator-resetpassword=""
data-amplify-authenticator-forgotpassword=""
data-amplify-form=""
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`ForgotPassword renders as expected 1`] = `
<form
data-amplify-authenticator-resetpassword=""
data-amplify-authenticator-forgotpassword=""
data-amplify-form=""
>
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/components/authenticator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const hasRouteComponent = computed(() => {
v-if="route === 'forgotPassword'"
ref="ForgotPasswordComponent"
>
<template #resetPasswordSlotI>
<template #forgotPasswordSlotI>
<slot name="forgot-password"></slot>
</template>
<template #header>
Expand Down
4 changes: 2 additions & 2 deletions packages/vue/src/components/forgot-password.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ const onBackToSignInClicked = (): void => {
</script>

<template>
<slot v-bind="$attrs" name="resetPasswordSlotI">
<slot v-bind="$attrs" name="forgotPasswordSlotI">
<base-form
v-bind="$attrs"
data-amplify-authenticator-resetpassword
data-amplify-authenticator-forgotpassword
@input="onInput"
@submit.prevent="onResetPasswordSubmit"
>
Expand Down

0 comments on commit 4ff26e2

Please sign in to comment.