Skip to content

Commit

Permalink
style: remove trailing whitespace (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Nov 3, 2024
1 parent de65c12 commit a9bb575
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ app.addHook('preHandler', (request, reply, next) => {
The session plugin accepts the following options. It decorates the request with the `sessionStore` and a `session` object. The session data is stored server-side using the configured session store.
#### options
##### secret (required)
The secret used to sign the cookie. Must be an array of strings or a string with a length of 32 or greater or a custom signer.
The secret used to sign the cookie. Must be an array of strings or a string with a length of 32 or greater or a custom signer.

If an array, the first secret is used to sign new cookies and is the first to be checked for incoming cookies.
Further secrets in the array are used to check incoming cookies in the order specified.
Expand Down Expand Up @@ -190,10 +190,10 @@ fastify.decryptSession(sessionId, request, { maxAge: 86400 }, () => {
```

### Typescript support:
This plugin supports typescript, and you can extend fastify module to add your custom session type.
This plugin supports typescript, and you can extend fastify module to add your custom session type.

```ts
// Use module imports rather than commonjs' require for correct declaration merging in TypeScript.
// Use module imports rather than commonjs' require for correct declaration merging in TypeScript.

// Wrong ❌:
// const fastifySession = require('@fastify/session');
Expand Down
4 changes: 2 additions & 2 deletions types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare module 'fastify' {
/** A session store. */
sessionStore: Readonly<fastifySession.SessionStore>;
}

interface Session extends ExpressSessionData { }
}

Expand Down Expand Up @@ -129,7 +129,7 @@ declare namespace fastifySession {

/**
* The algorithm used to sign the cookie.
*
*
* @default 'sha256'
*/
algorithm?: string;
Expand Down

0 comments on commit a9bb575

Please sign in to comment.