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

public class ConfirmResetPasswordState is missing public func move(to ..) #64

Closed merbula closed 6 months ago

merbula commented 6 months ago

Hi,

public class ConfirmResetPasswordState is missing following function:

public func move(to initialStep: AuthenticatorInitialStep) { authenticatorState.move(to: initialStep) }

Because of that I cannot set initial step in my custom reset password confirmation view to desired step (.signIn). Similar function can be found from public class ResetPasswordState implementation.

ruisebas commented 6 months ago

Hi @merbula, thanks for opening this issue. We'll take a look and post and update once we have more info.

ruisebas commented 6 months ago

Authenticator's version 1.1.2 now exposes an API to manually transition the component to another initial step through the AuthenticatorState environment object.

You should be able to do something like this:

struct CustomConfirmResetPasswordView: View {
    @Environment(\.authenticatorState) private var authenticatorState
    @ObservedObject var state: ConfirmResetPasswordState

    var body: some View {
        Button("Go Back") {
            authenticatorState.move(to: .resetPassword)
        }
    }
}
github-actions[bot] commented 6 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.