<BlockSwitcher>

<Block name="Async/Await">

```swift
func confirmAttribute() async {
    do {
        try await Amplify.Auth.confirm(userAttribute: .email, confirmationCode: "390739")
        print("Attribute verified")
    } catch let error as AuthError {
        print("Update attribute failed with error \(error)")
    } catch {
        print("Unexpected error: \(error)")
    }
}
```

</Block>

<Block name="Combine">

```swift
func confirmAttribute() -> AnyCancellable {
    Amplify.Publisher.create {
        try await Amplify.Auth.confirm(userAttribute: .email, confirmationCode: "390739")
        }.sink {
            if case let .failure(authError) = $0 {
                print("Update attribute failed with error \(authError)")
            }
        }
        receiveValue: { _ in
            print("Attribute verified")
        }
}
```

</Block>

</BlockSwitcher>
