First I have successfully completed configuring my react application using amplify configure
. I did that with the help of AWS Amplify docs. Then I have successfully added authentication to my amplify project, using amplify add auth
and amplify push
. I followed all the steps in the AWS - Authentication with Amplify Doc
My App.js
looks like this,
import React from 'react';
import { withAuthenticator, AmplifySignOut } from '@aws-amplify/ui-react';
import Amplify, { Auth } from 'aws-amplify';
import awsconfig from './aws-exports';
Amplify.configure(awsconfig);
const App = () => (
<div>
<AmplifySignOut />
My App
</div>
);
export default withAuthenticator(App);