From 0b1889cfee517359029e6cff877d3794bfa3ba58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Espen=20Dall=C3=B8kken?= Date: Wed, 30 Aug 2023 15:18:44 +0200 Subject: [PATCH] docs - update @fastify/session docs As mentioned in https://github.com/fastify/session/issues/193, "secret" is now required by @fastify/session --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 651f4f0..fa1b372 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ If you use `@fastify/csrf-protection` with `@fastify/session`, the CSRF secret w By default, the key used will be named `_csrf`, but you can rename it via the `sessionKey` option. ```js -fastify.register(require('@fastify-session')) +fastify.register(require('@fastify-session'), { secret: "a string which is longer than 32 characters" }) fastify.register(require('@fastify/csrf-protection'), { sessionPlugin: '@fastify/session' }) // generate a token @@ -99,7 +99,7 @@ If you use `@fastify/csrf-protection` with `@fastify/secure-session`, the CSRF s By default, the key used will be named `_csrf`, but you can rename it via the `sessionKey` option. ```js -fastify.register(require('@fastify/secure-session')) +fastify.register(require('@fastify/secure-session'), { secret: "a string which is longer than 32 characters" }) fastify.register(require('@fastify/csrf-protection'), { sessionPlugin: '@fastify/secure-session' }) // generate a token