Skip to content

The external login UI is not working when closing the dialog programmatically #3896

@medhatIbsais-Harri

Description

@medhatIbsais-Harri

Describe the bug

The external login dialog is not appearing again when dismissing it programmatically, the idea that we have an app the at some states we changes the root view controller, if the user prompted the external login UI and the root view changed, if the user tried again to prompt the external login dialog, it will get stuck and the dialog will not appear again,
we have two apps, the first one uses Amplify and the other one uses AWSMobileClient, it works normally on the who that uses AWSMobileClient, but its not working on Amplify, check the screen recording on Drive please
Screen recordings

you can use the code below for example to dismiss the presented view controller

 // check if there is any presented view
 if let presentedViewController = UIApplication.shared.windows.first(where: { $0.isKeyWindow })?.rootViewController?.presentedViewController {
                
  // dismiss
 presentedViewController.dismiss(animated: false, completion: nil)
 }

Steps To Reproduce

Steps to reproduce the behavior:
1. Type the external login company URL
2. When the external login dialog appears, change the root controller or simply dismiss the presented view controller like the code added in the description 
3. Try to prompt the dialog again 
4. It will not appear

Expected behavior

it should work normally and show the dialog

Amplify Framework Version

1.31.0

Amplify Categories

Auth

Dependency manager

Cocoapods

Swift version

5.0

CLI version

Not installed

Xcode version

15.4

Is this a regression?

No

Regression additional context

No response

Platforms

iOS

OS Version

17.4

Device

iPad mini 6th generation

Specific to simulators

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues related to the Auth categoryquestionGeneral question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions