---
title: whenUserSignsOut
framework: CloudKit JS
role: symbol
role_heading: Instance Method
platforms: [cloudkit js 1.0+]
path: cloudkitjs/cloudkit.container/whenusersignsout
---

# whenUserSignsOut

Returns an object representing a deferred or asynchronous operation that resolves when the user signs out.

## Declaration

```data
Promise<Undefined, CloudKit.CKError> whenUserSignsOut();
```

## Return Value

Return Value A Promise object that resolves to Undefined when the user signs out, or rejects to a CKError object.

## Discussion

Discussion Use the whenUserSignsOut method to call a function when the user signs out. myContainer.whenUserSignsOut().then(function() {     // The user signed out });

## See Also

### Authenticating Users

- [setUpAuth](cloudkitjs/cloudkit.container/setupauth.md)
- [whenUserSignsIn](cloudkitjs/cloudkit.container/whenusersignsin.md)
