Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formFields are not applied to forgotPassword page #4766

Closed
4 tasks done
MauriceHeinze opened this issue Nov 17, 2023 · 3 comments
Closed
4 tasks done

formFields are not applied to forgotPassword page #4766

MauriceHeinze opened this issue Nov 17, 2023 · 3 comments
Labels
not-reproducible Not able to reproduce the issue

Comments

@MauriceHeinze
Copy link

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React

Which UI component?

Authenticator

How is your app built?

Vite

What browsers are you seeing the problem on?

Chrome

Which region are you seeing the problem in?

No response

Please describe your bug.

The custom form fields are not applied to the reset password page.

What's the expected behaviour?

I expect to see my custom label ("Your Email Address") on the reset password page.

Help us reproduce the bug!

Copy paste my code and click on "forgot your password?"

Code Snippet

import { useAuthenticator, View, useTheme, Authenticator, Button, Flex, Heading, Image, Text } from '@aws-amplify/ui-react';
import '@aws-amplify/ui-react/styles.css';
import { Amplify } from 'aws-amplify';
import awsExports from '../aws-exports';
import { useEffect } from 'react';

Amplify.configure({
Auth: {
region: awsExports.REGION,
userPoolId: awsExports.USER_POOL_ID,
userPoolWebClientId: awsExports.USER_POOL_APP_CLIENT_ID
}
})

const components = {
Header() {
const { tokens } = useTheme();

return (
  <View textAlign="center" padding={tokens.space.large}>
    <Image
      alt="Amplify logo"
      src="../src/assets/logo.svg"
    />
  </View>
);

},

SignIn: {
Header() {
const { tokens } = useTheme();

  return (
    <Heading
      padding={`${tokens.space.xl} 0 0 ${tokens.space.xl}`}
      level={3}
    >
      Sign in to your account
    </Heading>
  );
},

},
};

const formFields = {
signIn: {
username: {
placeholder: '',
isRequired: true,
label: 'Email:'
},
password: {
placeholder: '',
isRequired: true,
label: 'Password:'
},
},
forgotPassword: {
username: {
placeholder: '',
isRequired: true,
label: 'Your Email Address'
},
},
forceNewPassword: {
password: {
placeholder: '',
isRequired: true,
label: 'New Password:',
},
confirm_password: {
placeholder: '',
isRequired: true,
label: 'Repeat New Password:',
}
},
confirmResetPassword: {
confirmation_code: {
placeholder: '',
isRequired: true,
label: 'Confirmation Code:',
},
password: {
placeholder: '',
isRequired: true,
label: 'New Password:',
},
confirm_password: {
placeholder: '',
isRequired: true,
label: 'Repeat New Password',
},
},
setupTotp: {
QR: {
totpIssuer: 'test issuer',
totpUsername: 'amplify_qr_test_user',
},
confirmation_code: {
placeholder: '',
isRequired: true,
label: 'Confirmation Code:',
},
},
confirmSignIn: {
confirmation_code: {
placeholder: '',
isRequired: true,
label: 'MFA code',
},
},
};

function App() {

return (



{({ signOut, user }) => (

Hello {user?.username}


Sign out

)}


);
}

export default App;

Console log output

No response

Additional information and screenshots

No response

@github-actions github-actions bot added the pending-triage Issue is pending triage label Nov 17, 2023
@calebpollman
Copy link
Member

@MauriceHeinze Was unable to reproduce this issue in @aws-amplify/[email protected]. Can you verify that you using the latest version?

@calebpollman calebpollman added pending-response not-reproducible Not able to reproduce the issue and removed pending-triage Issue is pending triage labels Nov 17, 2023
@MauriceHeinze
Copy link
Author

MauriceHeinze commented Nov 20, 2023

Hi @calebpollman,

Thanks for the info! Somehow my Amplify version was locked to 5.3.12 and I didn't work with version 6. Nevertheless what solved my error was using resetPassword instead of forgotPassword like it tolds you in the documentation here: https://ui.docs.amplify.aws/react/connected-components/authenticator/customization#updating-labels-placeholders-required-fields-and-showing-labels:~:text=confirmation_code-,forgotPassword,-username

@ioanabrooks
Copy link
Contributor

@MauriceHeinze going to close this, let us know if you have any other issues!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-reproducible Not able to reproduce the issue
Projects
None yet
Development

No branches or pull requests

3 participants