Giter Club home page Giter Club logo

Comments (9)

GeorgeBellTMH avatar GeorgeBellTMH commented on July 28, 2024 6

@jordanranz can you let us know what the built-in workaround is?

from amplify-ui.

sammartinez avatar sammartinez commented on July 28, 2024

@vchaddha can you provide a code snippet of your Authenticator component? Thanks ahead of time

from amplify-ui.

vchaddha avatar vchaddha commented on July 28, 2024

Below is the component that I am using for auth

<amplify-authenticator [signUpConfig]="signUpConfig" [hide]="['Greetings']"></amplify-authenticator>

Below is the signUpConfig

signUpFields: [
      {
        label: 'Username',
        key: 'username',
        required: true,
        displayOrder: 1,
        type: 'string'
      },
      {
        label: 'Password',
        key: 'password',
        required: true,
        displayOrder: 2,
        type: 'password'
      },
      { 
        key: 'custom:name',
        label: 'Hospital Name',
        displayOrder: 3,
        required: true,
        type: 'string'
      },
      {
        label: 'Zip Code',
        key: 'custom:zipcode',
        required: true,
        displayOrder: 4,
        type: 'string'
      },
      {
        label: 'Email',
        key: 'email',
        required: true,
        displayOrder: 5,
        type: 'string'
      },
      {
        label: 'Phone Number',
        key: 'phone_number',
        required: true,
        displayOrder: 6,
        type: 'string'
      }
    ]
  };

from amplify-ui.

jordanranz avatar jordanranz commented on July 28, 2024

Was able to speak offline about this and find a built-in workaround. Going to build better handling into the new UI components.

from amplify-ui.

ivandimov avatar ivandimov commented on July 28, 2024

Hey there, we have simillar issue. We are autoConfirming the users, but still want to send them an email with code, to verify their email address. When we pass the autoConfirm flag to true, it does not send them an email. We want to actually verify the email by sending them the code, because we can't just "trust" them and autoverify the emails too. I tried to use resendConfirmationCodeAsync, but it returns me an error, that the user is already verified. Any ideas on how to do this, or any workaround?

from amplify-ui.

AdamGustavsson avatar AdamGustavsson commented on July 28, 2024

Any news on this?
I'm loosing 70% of users in the verification step and desperately want to get rid of it.
Pre Sign-up Lambda Trigger works fine but the UI still shows the step (and no code is emailed)

from amplify-ui.

ericclemmons avatar ericclemmons commented on July 28, 2024

At the very least, the verification step should be skipped when:

User cannot be confirmed. Current status is CONFIRMED

from amplify-ui.

ErikCH avatar ErikCH commented on July 28, 2024

Hi @vchaddha and @AdamGustavsson

I am working on a solution for this with the new Authenticator. I'll be giving more updates shortly.

You can find more about the new authenticator here

from amplify-ui.

ErikCH avatar ErikCH commented on July 28, 2024

The updates in the new authenticator are now merged and in place. If you're using a PreSign up lambda trigger to auto confirm users, the authenticator will detect this and now skip the confirm verify page.

Please note, that if the user is confirmed, but their email is NOT confirmed, the next time they sign in they will be asked if they'd like to confirm their email. They don't have to confirm their email, they will still have an option to skip at the bottom of the page.

If you'd like a user to never confirm their email, then you'll need to setup the lambda trigger to confirm the email as well as the user. Like this.

 exports.handler = async (event, context, callback) => {
    // Confirm the user
    event.response.autoConfirmUser = true;
    // Set the email as verified if it is in the request
    if (event.request.userAttributes.hasOwnProperty('email')) {
      event.response.autoVerifyEmail = true;
    }
    // Set the phone number as verified if it is in the request
    if (event.request.userAttributes.hasOwnProperty('phone_number')) {
      event.response.autoVerifyPhone = true;
    }
    callback(null, event);
  };

I'll close this issue, but feel free to create another one if this doesn't work for you.

Here is the documentation to get started if you'd like to try this out

https://ui.docs.amplify.aws/ui/getting-started/installation

from amplify-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.