Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: remove trailing whitespace #276

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading