Amazon Cognito lets you add user sign-up, sign-in, and access control to your web and mobile apps quickly and easily. Amazon Cognito scales to millions of users and supports sign-in with social identity providers, such as Apple, Facebook, Google, and Amazon, and enterprise identity providers via SAML 2.0 and OpenID Connect.
Quick start
Follow these steps if you want to enable Amazon Cognito authentication in your application.
1. Enable AuthProvider
Enable Cognito's AuthProvider in /src/pages/_app.tsx.
import { AuthProvider } from "./contexts/CognitoContext";
function App() {
return (
<AuthProvider>
{content}
</AuthProvider>;
)
}
2. Enable useAuth hook
Enable Amazon Cognito's useAuth hook in /src/hooks/useAuth.ts.