Skip to content

Commit 6502156

Browse files
Merge pull request #2063 from micalevisk/feat/issue-2040
docs(): add notice regarding fastify-csrf plugin usage
2 parents 19b5eb0 + 89e20c7 commit 6502156

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

content/security/csrf.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ Start by installing the required package:
1010
$ npm i --save csurf
1111
```
1212

13-
> warning **Warning** As explained on the [csurf middleware page](https://github.com/expressjs/csurf#csurf), the csurf module requires either session middleware or a cookie-parser to be initialized first. Please see that documentation for further instructions.
13+
> warning **Warning** As explained in the [`csurf` docs](https://github.com/expressjs/csurf#csurf), this middleware requires either session middleware or `cookie-parser` to be initialized first. Please see that documentation for further instructions.
1414
15-
Once the installation is complete, apply the csurf middleware as global middleware.
15+
Once the installation is complete, apply the `csurf` middleware as global middleware.
1616

1717
```typescript
1818
import * as csurf from 'csurf';
19+
// ...
1920
// somewhere in your initialization file
2021
app.use(csurf());
2122
```
@@ -32,6 +33,9 @@ Once the installation is complete, register the `fastify-csrf` plugin, as follow
3233

3334
```typescript
3435
import fastifyCsrf from 'fastify-csrf';
35-
// somewhere in your initialization file
36+
// ...
37+
// somewhere in your initialization file after registering some storage plugin
3638
app.register(fastifyCsrf);
3739
```
40+
41+
> warning **Warning** As explained in the `fastify-csrf` docs [here](https://github.com/fastify/fastify-csrf#usage), this plugin requires a storage plugin to be initialized first. Please, see that documentation for further instructions.

0 commit comments

Comments
 (0)