Skip to content

Commit

Permalink
Applied readme changes based on review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Hobbs committed Oct 9, 2019
1 parent 9d65c7f commit 4a93f1a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,23 +216,21 @@ credentialsManager.credentials { error, credentials in

#### Clearing credentials and revoking refresh tokens

Credentials can be cleared by using the `clear` function, which clears credentials from memory:
Credentials can be cleared by using the `clear` function, which clears credentials from the keychain:

```swift
let didClear = credentialsManager.clear()
```

In addition, credentials can be cleared and the refresh token revoked using a single call to `revoke`. This function will attempt to revoke any associated refresh token that has been stored, before clearing the credentials from memory. If revoking the token results in an error, then the credentials are not cleared.

This method is asynchronous, so a callback should be specified to handle the result:
In addition, credentials can be cleared and the refresh token revoked using a single call to `revoke`. This function will attempt to revoke the current refresh token stored by the credential manager and then clear credentials from the keychain. If revoking the token results in an error, then the credentials are not cleared:

```swift
credentialsManager.revoke { error in
guard error == nil else {
return print("Failed to clear credentials")
return print("Failed to revoke refresh token: \(error)")
}

print("Credentials cleared")
print("Success")
}
```

Expand Down

0 comments on commit 4a93f1a

Please sign in to comment.