Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Amplify Auth: How to disable AmplifyConfirmSignUp?

I'm currently using AWS Amplify auth, using Cognito for React authentication. User sign-ups must confirm their new account by clicking on a confirmation link they receive via email.

When a submits their sign-up info, the next UI that is displayed is Confirm Signup that asks the user to confirm a code. I do not need this stage, as this is handled when the user confirms their email.

I'm using the react-ui Amplify components to control authentication and user signup/in/out.

import React from "react";
import "./App.css";
import { BrowserRouter as Router } from "react-router-dom";
import "bootstrap/dist/css/bootstrap.min.css";
import { Container } from "react-bootstrap";
import NavBar from "./components/NavBar.js";

import {
  AmplifyAuthenticator,
  AmplifySignUp,
  AmplifyConfirmSignUp,
  AmplifySignOut,
} from "@aws-amplify/ui-react";

import RouteContainer from "./components/RouteContainer";

function App() {
  return (
    <div>
      <AmplifyAuthenticator usernameAlias="email">
        <AmplifySignUp
          slot="sign-up"
          usernameAlias="email"
          formFields={[
            {
              type: "email",
              label: "Enter your email",
              placeholder: "Enter your email",
              required: true,
            },
            {
              type: "password",
              label: "Enter your password",
              placeholder: "",
              required: true,
            },
            {
              type: "custom:postcode",
              label: "Enter your postcode",
              placeholder: "",
              required: true,
            },
          ]}
        >
          <AmplifyConfirmSignUp/>

        </AmplifySignUp>
        <AmplifySignOut />
        <Router>
          <Container>
            <RouteContainer />
          </Container>
        </Router>
        <NavBar />
      </AmplifyAuthenticator>
    </div>
  );
}

export default App;

Is there a prop I can pass to disable <AmplifyConfirmSignUp/> or another way to disable this from the standard sign-up flow?

Thanks.

like image 735
Brad Avatar asked May 12 '20 12:05

Brad


1 Answers

You can disable verification in Cognito panel.

  1. Go to https://console.aws.amazon.com/cognito/
  2. Click on "Manage User Pools"
  3. In "General settings" click on "MFA and verifications"
  4. Under "Which attributes do you want to verify?" choose "No verification"
like image 171
MarkoR Avatar answered Sep 28 '22 10:09

MarkoR