Skip to content

Amplify.Auth.signInWithWebUI(presentationAnchor: self.view.window!) without try await before it does not work. #5249

@NakaokaRei

Description

@NakaokaRei

Describe the content issue:
Amplify.Auth.signInWithWebUI(presentationAnchor: self.view.window!) without try await before it does not work.

Current

func signInWithWebUI() async {
    do {
        let signInResult = Amplify.Auth.signInWithWebUI(presentationAnchor: self.view.window!)
        if signInResult.isSignedIn {
            print("Sign in succeeded")
        }
    } catch let error as AuthError {
        print("Sign in failed \(error)")
    } catch {
        print("Unexpected error: \(error)")
    }
}

Contents to be modified

func signInWithWebUI() async {
    do {
        let signInResult = try await Amplify.Auth.signInWithWebUI(presentationAnchor: self.view.window!)
        if signInResult.isSignedIn {
            print("Sign in succeeded")
        }
    } catch let error as AuthError {
        print("Sign in failed \(error)")
    } catch {
        print("Unexpected error: \(error)")
    }
}

URL page where content issue is:
https://docs.amplify.aws/lib/auth/signin_web_ui/q/platform/ios/#update-infoplist:~:text=let%20signInResult%20%3D-,Amplify,-.Auth.

Metadata

Metadata

Assignees

No one assigned

    Labels

    amplify/iosMostly related to iOS software.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions