Cognito based authentication test in a RN App
Install dependencies and run the project using RN CLI.
npm i
cd ios && pod install && cd ..
npx run-ios
import {AmplifyAuthController} from "./AmplifyAuthController";
AmplifyAuthController.initAmplify(config) // Initializes amplify with the config
AmplifyAuthController.signUp(username, password, phoneNumber, ssn) // Creates a new user in the cognito user pool with the given values
AmplifyAuthController.resendConfirmationCode(username) // Resends email confirmation code
AmplifyAuthController.confirmSignUp(username, confirmationCode) // Verifies user email
AmplifyAuthController.signIn(username, password) // Logs a user in
AmplifyAuthController.signOut() // Logs out the current session
AmplifyAuthController.initPhoneNumberVerify() // Sends SMS verification code
AmplifyAuthController.completePhoneNumberVerify(confirmationCode) // Verifies user phone number