Skip to content

Commit a2c8091

Browse files
authored
style: remove trailing whitespace (#276)
1 parent 11d26fa commit a2c8091

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fastify.get('/login/facebook', {}, (req, reply) => {
5656
// The service provider redirect the user here after successful login
5757
fastify.get('/login/facebook/callback', async function (request, reply) {
5858
const { token } = await this.facebookOAuth2.getAccessTokenFromAuthorizationCodeFlow(request)
59-
59+
6060
console.log(token.access_token)
6161

6262
// if later need to refresh the token this can be used
@@ -95,7 +95,7 @@ fastify.register(oauthPlugin, {
9595
})
9696
```
9797

98-
Additionally, you can customize the names of the cookies by setting the `redirectStateCookieName` and `verifierCookieName` options.
98+
Additionally, you can customize the names of the cookies by setting the `redirectStateCookieName` and `verifierCookieName` options.
9999
The default values for these cookies are `oauth2-code-verifier` for `verifierCookieName` and `oauth2-redirect-state` for `redirectStateCookieName`.
100100

101101
```js
@@ -155,7 +155,7 @@ fastify.register(oauthPlugin, {
155155

156156
## Use automated discovery endpoint
157157

158-
When your provider supports OpenID connect discovery and you want to configure authorization, token and revocation endpoints automatically,
158+
When your provider supports OpenID connect discovery and you want to configure authorization, token and revocation endpoints automatically,
159159
then you can use discovery option.
160160
`discovery` is a simple object that requires `issuer` property.
161161

@@ -179,7 +179,7 @@ fastify.register(oauthPlugin, {
179179
callbackUri: 'http://localhost:3000/callback',
180180
discovery: { issuer: 'https://identity.mycustomdomain.com' }
181181
// pkce: 'S256', you can still do this explicitly, but since discovery is used,
182-
// it's BEST to let plugin do it itself
182+
// it's BEST to let plugin do it itself
183183
// based on what Authorization Server Metadata response
184184
});
185185
```
@@ -309,9 +309,9 @@ fastify.register(oauthPlugin, {
309309
access_type: 'offline', // will tell Google to send a refreshToken too
310310
},
311311
pkce: 'S256'
312-
// check if your provider supports PKCE,
313-
// in case they do,
314-
// use of this parameter is highly encouraged
312+
// check if your provider supports PKCE,
313+
// in case they do,
314+
// use of this parameter is highly encouraged
315315
// in order to prevent authorization code interception attacks
316316
});
317317
```
@@ -362,8 +362,8 @@ This fastify plugin adds 6 utility decorators to your fastify instance using the
362362

363363
- OR `getAccessTokenFromAuthorizationCodeFlow(request, reply, callback)` variant with 3 arguments, which should be used when PKCE extension is used.
364364
This allows fastify-oauth2 to delete PKCE code_verifier cookie so it doesn't stay in browser in case server has issue when fetching token. See [Google With PKCE example for more](./examples/google-with-pkce.js).
365-
366-
*Important to note*: if your provider supports `S256` as code_challenge_method, always prefer that.
365+
366+
*Important to note*: if your provider supports `S256` as code_challenge_method, always prefer that.
367367
Only use `plain` when your provider doesn't support `S256`.
368368

369369

@@ -400,7 +400,7 @@ fastify.googleOAuth2.revokeAllToken(currentAccessToken, undefined, (err) => {
400400
- `userinfo(tokenOrTokenSet)`: A function to retrieve userinfo data from Authorization Provider. Both token (as object) or `access_token` string value can be passed.
401401

402402
Important note:
403-
Userinfo will only work when `discovery` option is used and such endpoint is advertised by identity provider.
403+
Userinfo will only work when `discovery` option is used and such endpoint is advertised by identity provider.
404404

405405
For a statically configured plugin, you need to make a HTTP call yourself.
406406

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ declare namespace fastifyOauth2 {
182182
httpOptions: Object | undefined,
183183
callback: (err: any) => void
184184
): void;
185-
185+
186186
revokeAllToken(revokeToken: Token, httpOptions: Object | undefined): Promise<void>;
187187

188188
userinfo(tokenSetOrToken: Token | string): Promise<Object>;

types/index.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ server.get('/testOauth/callback', async (request, reply) => {
293293
expectNotAssignable<UserInfoExtraOptions>({ via: 'donkey' });
294294
expectNotAssignable<UserInfoExtraOptions>({ something: 1 });
295295
// END userinfo tests
296-
296+
297297
expectType<string>(await server.testOAuthName.generateAuthorizationUri(request, reply));
298298
// error because missing reply argument
299299
expectError<string>(server.testOAuthName.generateAuthorizationUri(request));

0 commit comments

Comments
 (0)