<BlockSwitcher>

<Block name="Async/Await">

```swift
func forgetDevice() async {
    do {
        try await Amplify.Auth.forgetDevice()
        print("Forget device succeeded")
    } catch let error as AuthError {
        print("Forget device failed with error \(error)")
    } catch {
        print("Unexpected error: \(error)")
    }  
}
```

</Block>

<Block name="Combine">

```swift
func forgetDevice() -> AnyCancellable {
    Amplify.Publisher.create {
        try await Amplify.Auth.forgetDevice()
    }.sink {
            if case let .failure(authError) = $0 {
                print("Forget device failed with error \(authError)")
            }
        }
        receiveValue: {
            print("Forget device succeeded")
        }
}
```

</Block>

</BlockSwitcher>
