Skip to content

Commit

Permalink
feat: allow csrf to disable sharing of token via cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Mar 6, 2020
1 parent d16ae22 commit 95399d7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions templates/shield.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,22 @@ export const csrf: ShieldConfig['csrf'] = {
*/
exceptRoutes: [],

/*
|--------------------------------------------------------------------------
| Enable Sharing Token Via Cookie
|--------------------------------------------------------------------------
|
| When the following flag is enabled, AdonisJS will drop `XSRF-TOKEN`
| cookie that frontend frameworks can read and return back as a
| `X-XSRF-TOKEN` header.
|
| The cookie has `httpOnly` flag set to false, so it is little insecure and
| can be turned off when you are not using a frontend framework making
| AJAX requests.
|
*/
enableXsrfCookie: true,

/*
|--------------------------------------------------------------------------
| Methods to Validate
Expand Down

0 comments on commit 95399d7

Please sign in to comment.