Skip to content

autoSignIn() only works in a happy path #4082

@marapz

Description

@marapz

Describe the bug

The same issue was found in the Android SDK: aws-amplify/amplify-android#3135

The autoSignIn() only works in a happy path, that is:

  1. signUp
  2. confirmSignUp
  3. autoSignIn

But it gets stuck (no result returned from the autoSignIn() method) if I do this:

  1. signUp
  2. confirmSignUp with wrong code
  3. confirmSignUp with correct code
  4. autoSignIn <-- stuck

Previously this wasn't an issue for me, since I just performed the login for the user, and that always worked, but once we started using 2FA, the user was asked to enter the confirm account code, and then immediately after to enter the 2FA code.

Steps To Reproduce

1. signUp
2. confirmSignUp with wrong code
3. confirmSignUp with correct code
4. autoSignIn <-- stuck

Expected behavior

Amplify.Auth.autoSignIn() should return a value.

Amplify Framework Version

2.51.2

Amplify Categories

Auth

Dependency manager

Swift PM

Swift version

6

CLI version

.

Xcode version

26.0

Relevant log output

<details>
<summary>Log Messages</summary>


INSERT LOG MESSAGES HERE

</details>

Is this a regression?

Yes

Regression additional context

No response

Platforms

No response

OS Version

26.1

Device

iPhone 16 Pro

Specific to simulators

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues related to the Auth categorybugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions