<BlockSwitcher>

<Block name="Async/Await">

```swift
import AWSCognitoAuthPlugin

func signOutGlobally() async {
    let result = await Amplify.Auth.signOut(options: .init(globalSignOut: true))
    guard let signOutResult = result as? AWSCognitoSignOutResult
    else {
        print("Signout failed")
        return
    }

    print("Local signout successful: \(signOutResult.signedOutLocally)")
    switch signOutResult {
    case .complete:
        // handle successful sign out
    case .failed(let error):
        // handle failed sign out
    case let .partial(revokeTokenError, globalSignOutError, hostedUIError):
        // handle partial sign out
    }
}
```

</Block>

<Block name="Combine">

```swift
func signOutGlobally() -> AnyCancellable {
    Amplify.Publisher.create {
        await Amplify.Auth.signOut(options: .init(globalSignOut: true))
    }.sink(receiveValue: { result in
        guard let signOutResult = result as? AWSCognitoSignOutResult
        else {
            print("Signout failed")
            return
        }
        print("Local signout successful: \(signOutResult.signedOutLocally)")
        switch signOutResult {
        case .complete:
            // handle successful sign out
        case .failed(let error):
            // handle failed sign out
        case let .partial(revokeTokenError, globalSignOutError, hostedUIError):
            // handle partial sign out
        }
    })
}
```

</Block>

</BlockSwitcher>
