aws-amplify / amplify-ui-swift-authenticator

The Amplify UI Authenticator is a component that supports several authentiation flows using Amplify Authentication.
https://ui.docs.amplify.aws/swift/connected-components/authenticator
Apache License 2.0
15 stars 9 forks source link

Delivery details destination is nil in custom sign up confirm view #62

Closed merbula closed 5 months ago

merbula commented 6 months ago

Background:

Steps to reproduce this issue:

  1. Sign up with custom view. User is redirected to sign up confirmation view -> delivery details destination is available. I can get the destination value and set it in to my text.
  2. Kill the app
  3. Launch the app again
  4. Do the login -> User is redirected in to custom sign up confirmation view

I want to show text like "Activation code is sent to %@" in custom sign up confirmation view but destination is nil.

5d commented 6 months ago

Hi @merbula, thank you for bringing this issue to our attention. We will investigate the matter and provide an update once we have gathered more details.

ruisebas commented 6 months ago

Hi @merbula, the behaviour you described is expected and coming directly from Amplify Swift: the delivery details destination is only available during the Sign Up flow, as the code is sent during the flow.

If you attempt to Sign In a non-confirmed user, you'll be instructed to confirm the user but no new code will be sent. Since neither the Authenticator nor Amplify Swift track the state of past authentication flows, there is no details destination information available at that moment.

Having said that, the Authenticator allows you to send a new code by calling state.sendCode() in which case a new details destination information becomes available and displayed in the default view. However, it's currently not updating the value of state.deliveryDetails, which makes it inaccessible for custom views. This is a bug and I'll work on fixing it.

ruisebas commented 5 months ago

This has been fixed in 1.1.2, now deliveryDetails is populated/updated when a new code is requested.

github-actions[bot] commented 5 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.