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
Copy file name to clipboardExpand all lines: README.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,7 +244,7 @@ Assuming we have registered multiple OAuth providers like this:
244
244
245
245
## Utilities
246
246
247
-
This fastify plugin adds 3 utility decorators to your fastify instance using the same **namespace**:
247
+
This fastify plugin adds 5 utility decorators to your fastify instance using the same **namespace**:
248
248
249
249
-`getAccessTokenFromAuthorizationCodeFlow(request, callback)`: A function that uses the Authorization code flow to fetch an OAuth2 token using the data in the last request of the flow. If the callback is not passed it will return a promise. The callback call or promise resolution returns an [AccessToken](https://github.com/lelylan/simple-oauth2/blob/master/API.md#accesstoken) object, which has an `AccessToken.token` property with the following keys:
250
250
-`access_token`
@@ -267,6 +267,18 @@ fastify.get('/external', { /* Hooks can be used here */ }, async (req, reply) =>
267
267
});
268
268
```
269
269
270
+
-`revokeToken(Token, tokenType, params, callback)`: A function to revoke the current access_token or refresh_token on the authorization server. If the callback is not passed it will return a promise. The callback call or promise resolution returns `void`
-`revokeAllToken(Token, params, callback)`: A function to revoke the current access_token and refresh_token on the authorization server. If the callback is not passed it will return a promise. The callback call or promise resolution returns `void`
E.g. For `name: 'customOauth2'`, the helpers `getAccessTokenFromAuthorizationCodeFlow` and `getNewAccessTokenUsingRefreshToken` will become accessible like this:
// This behavior is not documented on Apple Developer Docs but it display through runtime error.
219
+
// This behavior is not documented on Apple Developer Docs, but it displays through runtime error.
181
220
// Related Docs: https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms
182
221
// Related Issue: https://github.com/fastify/fastify-oauth2/issues/116
0 commit comments