AWS Cognito

At present, AWS uses a dummy config, so we don't need to change anything, but in actual implementation, you need to set poolId and appClientId in the following file. For more detail refer to AWS here: https://aws.amazon.com/cognito/

  1. Set AWS Config in .env

.
###
## AWS

VITE_APP_AWS_POOL_ID=
VITE_APP_AWS_APP_CLIENT_ID=
###
  1. Change AuthProvider

..\src\App.jsx
import { AWSCognitoProvider as AuthProvider } from 'contexts/AWSCognitoContext';
  1. Change auth Hooks

Comment another context in the following file and uncomment AWSCognito one.

..\src\hooks\useAuth.js
import AuthContext from 'contexts/AWSCognitoContext';
  1. Replace Login Code

It's super simple. We have provided a code that just needs to be replaced.

  • VITE:

    • From: src\views\pages\authentication\login\AWSCognitoLogin

    • To: src\views\pages\authentication\auth-forms\AuthLogin.jsx

  • NEXTJS:

    • From: src\components\Authentication\login\AWSCongnitoLogin

    • To: src\components\Authentication\auth-forms\AuthLogin.jsx

  1. Replace Register Code

  • VITE:

    • From: src\views\pages\authentication\register\AWSCognitoRegister

    • To: src\views\pages\authentication\auth-forms\AuthRegister.jsx

  • NEXTJS:

    • From: src\components\Authentication\register\AWSCognitoRegister

    • To: src\components\Authentication\auth-forms\AuthRegister.jsx

Last updated