Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [v3.8.5]

* Document `revokeAuthorization` options and behaviour [#116] - thanks @bensynapse!

# [v3.8.4]

* Bump axios dependency to version 1.12.0 #[107]
Expand Down Expand Up @@ -45,6 +49,7 @@
* Update dev dependencies and CI


[v3.8.5]: https://github.com/cronofy/cronofy-node/releases/tag/v3.8.5
[v3.8.2]: https://github.com/cronofy/cronofy-node/releases/tag/v3.8.3
[v3.8.2]: https://github.com/cronofy/cronofy-node/releases/tag/v3.8.2
[v3.8.1]: https://github.com/cronofy/cronofy-node/releases/tag/v3.8.1
Expand All @@ -56,6 +61,7 @@
[v3.5.1]: https://github.com/cronofy/cronofy-node/releases/tag/v3.5.1
[v3.5.0]: https://github.com/cronofy/cronofy-node/releases/tag/v3.5.0

[#116]: https://github.com/cronofy/cronofy-node/pull/116
[#106]: https://github.com/cronofy/cronofy-node/pull/106
[#98]: https://github.com/cronofy/cronofy-node/pull/98
[#97]: https://github.com/cronofy/cronofy-node/pull/97
Expand Down
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,28 @@ Takes an optional callback, either returning a promise for, or calling the provi
- **code** - required - The short-lived, single-use code issued to you when the user authorized your access to their account as part of an Authorization Request.
- **redirect_uri** - required - The same HTTP or HTTPS URI you passed when requesting the user's authorization.

### revokeAuthorization(callback)
### revokeAuthorization(options, callback)

Takes an optional callback, either returning a promise for, or calling the provided callback with an empty object in the success case.
Revokes the authorization identified by `options.token` or `options.sub`.
Returns a promise, or calls the optional callback without arguments on success.
After a successful response, the client clears its stored access and refresh tokens.

#### Options object

- `token`: A refresh token (recommended) or access token for the authorization to revoke. Required unless `sub` is provided.
- `sub`: The account's `sub` value. Required unless `token` is provided. If both are supplied, `token` takes priority.
- `client_id`: Your OAuth client ID. Required unless set on the client.
- `client_secret`: Your OAuth client secret. Required unless set on the client.

Configured `access_token` and `refresh_token` values do not supply `options.token`. Pass the token explicitly:

```javascript
cronofyClient.revokeAuthorization({
token: process.env.CRONOFY_REFRESH_TOKEN
});
```

See the [Revoking Authorization documentation](https://docs.cronofy.com/developers/api/authorization/revoke/) for the API contract.

### elevatedPermissions(options, callback)

Expand Down
Loading