You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Refresh an access token](#refresh-an-access-token)
25
+
-[Revoke an access or refresh token](#revoke-an-access-or-refresh-token)
24
26
-[Errors](#errors)
25
27
-[Debugging the module](#debugging-the-module)
26
28
-[Contributing](#contributing)
@@ -153,23 +155,21 @@ See the [API reference](./API.md#new-clientcredentialsoptions) for a complete re
153
155
154
156
### Access Token
155
157
156
-
When a token expires we need to refresh it. Simple OAuth2 offers the AccessToken class that add a couple of useful methods to refresh the access token when it is expired.
158
+
On completion of any [supported grant type](#supported-grant-types) an access token will be obtained. A list of supported operations can be found below.
159
+
160
+
#### Refresh an access token
161
+
162
+
When a token expires we need a mechanism to obtain a new access token. The [AccessToken](./API.md#accesstoken) methods can be used to perform the token refresh process.
When you've done with the token or you want to log out, you can revoke the access and refresh tokens.
202
+
See the [API reference](./API.md#accesstoken) for a complete reference of available options.
203
+
204
+
#### Revoke an access or refresh token
205
+
206
+
When you've done with the token or you want to log out, you can revoke both access and refresh tokens.
203
207
204
208
```javascript
205
209
asyncfunctionrun() {
@@ -218,7 +222,6 @@ As a convenience method, you can also revoke both tokens in a single call:
218
222
219
223
```javascript
220
224
asyncfunctionrun() {
221
-
// Revoke both access and refresh tokens
222
225
try {
223
226
// Revokes both tokens, refresh token is only revoked if the access_token is properly revoked
224
227
awaitaccessToken.revokeAll();
@@ -230,26 +233,25 @@ async function run() {
230
233
run();
231
234
```
232
235
233
-
### Errors
234
-
235
-
Errors are returned when a 4xx or 5xx status code is received.
236
+
See the [API reference](./API.md#accesstoken) for a complete reference of available options.
236
237
237
-
BoomError
238
+
### Errors
238
239
239
-
As a standard [boom](https://github.com/hapijs/boom) error you can access any of the [boom error properties](https://hapi.dev/module/boom/api). The total amount of information varies according to the generated status code.
240
+
Whenever a client or server error is produced, a [boom](https://github.com/hapijs/boom) error is thrown by the library. As such any [boom error property](https://hapi.dev/module/boom/api) is available, but the exact information may vary according to the type of error.
0 commit comments