Skip to content

Instantly share code, notes, and snippets.

@dipeshhkc
Last active May 22, 2021 10:22
Show Gist options
  • Save dipeshhkc/2f0ed0c6b95bbe42a97286df131f79e6 to your computer and use it in GitHub Desktop.
Save dipeshhkc/2f0ed0c6b95bbe42a97286df131f79e6 to your computer and use it in GitHub Desktop.
const signInFields = [
{
type: "email",
label: "Email",
placeholder: "Please enter your Email",
required: true,
},
{
type: "password",
label: "Password",
placeholder: "Please enter your Password",
required: true,
},
];
const signUpFields = [
{
type: "username",
label: "Username",
placeholder: "Please enter your Username",
required: true,
},
{
type: "email",
label: "Email",
placeholder: "Please enter your Email",
required: true,
},
{
type: "password",
label: "Password",
placeholder: "Please enter your Password",
required: true,
},
];
const App = () => (
<AmplifyAuthenticator usernameAlias="email">
<AmplifySignUp
headerText="Sign Up"
slot="sign-up"
usernameAlias="email"
formFields={signUpFields}>
</AmplifySignUp>'
<AmplifySignIn
headerText="Log in to Dashboard"
slot="sign-in"
usernameAlias="email"
formFields={signInFields}>
</AmplifySignIn>
<BrowserRouter>
<Switch>
//React Routes
<Route path="/" component={Home} />
</Switch>
</BrowserRouter>
</AmplifyAuthenticator>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment