{"versions":{"1.0.0":{"name":"csrf-sync","version":"1.0.0","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","module":"es2020","exports":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:code":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:code","build:clean":"npm run clean && npm run build && npm run build:types"},"author":{"name":"psibean"},"license":"MIT","devDependencies":{"@types/express":"^4.17.14","@types/express-session":"^1.17.5","@typescript-eslint/eslint-plugin":"^5.38.0","@typescript-eslint/parser":"^5.38.0","chai":"^4.3.6","eslint":"^8.23.1","mocha":"^10.0.0","prettier":"^2.7.1","ts-node":"^10.9.1","typescript":"^4.8.3"},"dependencies":{"@types/chai":"^4.3.3","@types/mocha":"^9.1.1"},"gitHead":"d6314832a051c15479d405848c28cc7f3716bdbb","_id":"csrf-sync@1.0.0","_nodeVersion":"18.9.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-FFdDIOqw4VBD/f6OFweQsRL3nfAwulYYzEBAoEoGpg5Satl46k4kPpvcxZBpdwQ/7bk3KrBgLPGJJDYEVC961Q==","shasum":"a676d8cfbf3ab9de421f1a3b86ec0a732ffde9ac","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-1.0.0.tgz","fileCount":5,"unpackedSize":12517,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARDtWk471QK1/tawi9j+GCpPgcqSiuPUPvWlkVu3XkpAiAf5ARzSLBr6Hk9NBMLXUoptDWOUTeQ0jS7StU64I54mg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLo40ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqCqhAAgKaPyIYv009g2YDqzC+fAWB+BgUTGFa3EZZrlnTIASkDrZ5J\r\nkroHfxsccprcSEo06XLHnb1mkO1RLi+ehSAdc4Xq/2MIwXPEl3ECwE8B9di+\r\nhaWHI6aOQaUVjC36paAhlDbYmVM5pHuvY2g1YjswMjE3cVmWyw5nQ9mtWSfB\r\nTGcvRjlQdPLq/MQ/QYvXPlpQJE6KaubhyHC/0jEqNYN0hGPon3DaJuSKRxRB\r\nrC4hSZkVDEbfM4Y6MRPXxypqdpBFlk5G/IXsRuwcm/Yonu4tmVkt35CKHGYx\r\nNb2EYjCXzQiK6gC0wZRkZz/EbSxqvRewYRYxYfJ1+xS93yKvOjxn8i4YGRpL\r\nq3EkYBWNP7p6d9UCGdPxUkWzBBbZbUNZ8F1bS5y/OhD2VtuV7O7RMVZDlrEG\r\nP/dRvvYzcrPV51kYDUDtIHqp9X3LqJ4xKKwkpT5KxARi90yDo5Veuyaoaxok\r\n5pRepyUquxuvlns5iIm8hnGeijPI6ZVz0RsGdcsObD1A6+ljXR/T7Xp7K8KO\r\nxfVn5a7U6VyDm/Ds8qapX2CvxmocyXOsw5etS4ts6cazfoHH/NZaDzueCmXg\r\niQdZVn1Mrhl6Pfj2lvwEfSW3oTWLsEGQmQRd0yq1z12k0f4MfKLKaPwW/ZyC\r\nsCMC2hT+AcNu5ccxBxdIpdug1ErNKZ2ez2M=\r\n=KHPT\r\n-----END PGP SIGNATURE-----\r\n","size":4739},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_1.0.0_1663995444667_0.1395067046773748"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-09-24T04:57:36.851Z","contributors":[]},"1.0.1":{"name":"csrf-sync","version":"1.0.1","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","module":"es2020","exports":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:code":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:code","build:clean":"npm run clean && npm run build && npm run build:types"},"author":{"name":"psibean"},"license":"MIT","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/express":"^4.17.14","@types/express-session":"^1.17.5","@typescript-eslint/eslint-plugin":"^5.38.0","@typescript-eslint/parser":"^5.38.0","chai":"^4.3.6","eslint":"^8.23.1","mocha":"^10.0.0","prettier":"^2.7.1","ts-node":"^10.9.1","typescript":"^4.8.3"},"dependencies":{"@types/chai":"^4.3.3","@types/mocha":"^9.1.1"},"gitHead":"2dd9447cbaad2b8a61f3edb9633388e5287490a5","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@1.0.1","_nodeVersion":"18.9.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-Ixts65jP/e6Px+GUweueC1+oMAjMSkr7KNah1S0VCB72i8ZafW3r8p09LV7RG5+yyBrbr77p8fhahG/gyW+P9g==","shasum":"14d7b6af025c923d8e656b783f55f405b0b4b09e","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-1.0.1.tgz","fileCount":5,"unpackedSize":12753,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDCLkSqDq4n6MiuM8rR42U5QzSexVIGJP7zOC717FzptAiA4suC6RnljAJHc9QuLnzOlB8LSgpL9+WP65KQY1M0TtQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLpiUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKYw/+MpcgXMOsPD92jEADLiIudsXDJx9xAX/qoMLXL560Ce/NlsAu\r\nbb0UcHDXpANyd9sEKHpSJM5tM360ful6TqQeDknoeMjCkOyHzdDpyLfa6eww\r\n5YXaY20MWYYnQKip5+FrBx72XoYptm8x3BprlRrvJ75UjeaR9+Xu9l2CyGl7\r\nuRe6z9cZvf0ptqe42mdH3DA2oA2gxx4PFxnXOdaoVhGk4VvkD08eexxwj9Dt\r\nl+A1iRccaQfVAjFyVwuZ6mw4ipr6Af02y9ypGoZ4J7DMpm28QWN3EvP8Fd3g\r\nMh/HiuTTA1y+mAm+E4Tw7dC6y8pW6Et5ciT0RaD8+RPg0XzIv3udJ3VOwUm5\r\nNj79BbFAALGrR/QviCV4d3Cuq/zV2p/vvjIFvivqRwzsdOGHSPofPIzdown4\r\ncQYYw6FJ76tszZaYfMNXpYlkmJCJN1GzXXzR6ZJNX84B3KY4KXnv9T1D+1kC\r\n3mDajcRTRcDQDSL4kY52pTEJoso64CnQCzT6YSMI8Fwih4SUNfL+LwUod7wF\r\n+feCZ+kGY+w19J9Cd3jVaSAeXoexQahp3zk3Atr8R/kaC/ArNMS0dyGzgPtU\r\ncWlctxO3qab9b6DK7HfIg5qVJcZN2O5fjp65Dls4JNBMhAH2jZ0hTjFDuuyV\r\nnPM5rLpcVnCiqzJWl8KOM+tR5TRQ9FFmO9c=\r\n=Pv1B\r\n-----END PGP SIGNATURE-----\r\n","size":4800},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_1.0.1_1663998100761_0.3385294265287613"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-09-24T05:41:48.009Z","contributors":[]},"1.0.2":{"name":"csrf-sync","version":"1.0.2","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","module":"es2020","exports":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:code":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:code","build:clean":"npm run clean && npm run build && npm run build:types"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/express":"^4.17.14","@types/express-session":"^1.17.5","@typescript-eslint/eslint-plugin":"^5.38.0","@typescript-eslint/parser":"^5.38.0","chai":"^4.3.6","eslint":"^8.23.1","mocha":"^10.0.0","prettier":"^2.7.1","ts-node":"^10.9.1","typescript":"^4.8.3"},"dependencies":{"@types/chai":"^4.3.3","@types/mocha":"^9.1.1"},"gitHead":"3a1b4045e57515d415b815aa109ceead99c33ecc","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@1.0.2","_nodeVersion":"18.9.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-OqKPN6K2NiXb+C6U1QVzDmCPVtnU8Ga3lnnEfJwJsYyRj+c8a8qo1xBRaaG7B80geUMHXz7FoQmYyU+seHwtIQ==","shasum":"628205adf6248a8620482669c9b5218a584536e3","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-1.0.2.tgz","fileCount":5,"unpackedSize":12753,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCn5Q0sk72Etkx3J3fA3kOuihtrlgxbl52Fa9+KxaRcRwIgbmGNivp0PBaCputSRFBD/cFYs8okVTKB9MOD0UafNWg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLp+hACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq9tA//Ru8Pv3cN25QC7hE9XdVSMFGYETFaQ+z0PI3rexx2QOndstj/\r\nuo8c6fMi1+gacdfEyTaT2KdhroIkpp+FKR/XcSXZXs22X2LsUlqpeOUMHkZP\r\nriQ8Lc8dZQ2MLn3JsQKrD0KkO+y7xjR8I8ZDtWbB9Tctm713Le03bZQ6Nzu8\r\nWXNxRNkRNeNxWa10NN3VHOpHyeKzg+i9dPZQORuvnUO+M5hGyrXnfLpMEXBm\r\nfEUK5lIHcRZGryoF1rMr9egXzA11VrO/uxZeoJlcHMzy0t6E5Jaz64BovncH\r\n4Dx8Zaz5yAUue3SCdKd1KQwt1jW2SuvaL48uTyQkB6qJgEcwKWp9sNZ1d9cf\r\nZn/XJWzFSJp44d5XwULpOTz1m3tw+dhhr7/sZILDonAncE7cq/1//ayZuNUT\r\nK7ELUfxN0CpnGrIQL+Ubp1CJyAXfFFQXkyJ2PxMmW6hk1Y2uc0EpnPcIKapJ\r\n8gKYJFKg4yXPE75MKLeubFw7bzYZ2iz6/FCvwjKYPCJqr4eNs1d2/6UA7guT\r\nLWidRDffNUUa2Ak1hEHhe6GLk0VXv+eOxUzvgYGP8SgWLiz4+87wkRA9WW44\r\nDc/5iYYkpykL1QBXQ3ckWXJvqgtDCkPBi/Z+Igmo+NGxmgzHZRr8njOqEfI/\r\nepFWv+rhNUQZWbXsOFfGuPVL+eMOixjzH+k=\r\n=qpss\r\n-----END PGP SIGNATURE-----\r\n","size":4800},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_1.0.2_1663999905484_0.017090473330808598"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-09-24T06:12:11.357Z","contributors":[]},"1.0.3":{"name":"csrf-sync","version":"1.0.3","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","module":"es2020","exports":"./lib/index.js","types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:code":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:code","build:clean":"npm run clean && npm run build && npm run build:types"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/express":"^4.17.14","@types/express-session":"^1.17.5","@types/http-errors":"^1.8.2","@typescript-eslint/eslint-plugin":"^5.38.0","@typescript-eslint/parser":"^5.38.0","chai":"^4.3.6","eslint":"^8.23.1","mocha":"^10.0.0","prettier":"^2.7.1","ts-node":"^10.9.1","typescript":"^4.8.3"},"dependencies":{"@types/chai":"^4.3.3","@types/mocha":"^9.1.1","http-errors":"^2.0.0","package-lock.json":"^1.0.0","package.json":"^2.0.1"},"gitHead":"a83c02d76da36424d00c2eea405ea03b170df78d","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@1.0.3","_nodeVersion":"18.9.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-mserEI/XbT60REbNWxfkSkHaqtOn8lyzp3N8hYfXi0+4Y7ZfAUb4bU19AsJqfEP3UyOQE8EatNM2mUWqIkjpSQ==","shasum":"b2417e677f7a053306fd88babdaf92677109343f","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-1.0.3.tgz","fileCount":5,"unpackedSize":12883,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOZkp/IAj2AhbWh8td/dl2t1M1Y3pU4YOWPh6O/zAHIAIgKDmMSE7vx34EtefXTeSvnzQu5GNccMqkHflIbC//EMk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjL8L7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/gg/+OQrXzFMhmD/adeFaKIQFKgzn9mVonedgMP+DjY1V58MmB0kl\r\nPfi8HUeE0nKA4X8GRmZ/Hwbe4bLjx5I2p1e9HtJL5XeF5cFKo7M+VN8BdH73\r\nmcvzv+sLM5+JV/u6lGRpw1MC6x1RCa0FsFj1okqfFBVouuVnbXwNSlMWeATu\r\nLPHJtpVnlZ7whOC543eb8m+q/nXemgB7R/ou9oEj+dWTZ2PyunI3spQHBw5d\r\nqW0d72Jtb4QP547YwxGstrkhbRg4UQzzrrS9DU/hAXD6yngbP1iX64P5gLFJ\r\nhYi9+KwK4mx3CeHfMoZaqju9mysBzQEgGKPiAj9o0r31iT+dEd6X4L1DHlEy\r\nEKs4dqm+HD9ZIhsQ0vf49APOOvP0Wi2f5Tzptd2Itq6c7U2XdA22iDL0hh4H\r\nQVmlgiWpaoA3vVc005qZofp6nu1DCBMyuzemV7CRD0GoXSOYm59NheEA+x0X\r\nZvcrKLz3Kme2okjIxgNSiwM0g/0UQbZiAir+xeH3elm4ibAh9N5FBsJxDrHB\r\nIH4/umQDaYldjepDje716hpySGAYRrkgWLlgpdSxmHFj5FqZ7LUCaeDL8R5u\r\nEdUSh0nma9jqKpvntKKawx3R/0ArCj2F+h1BPBCm/1b3q/L+RMCARwsZrXNM\r\nnIavSBqjZwsluLM0joHug5ROIREAlx3Uwao=\r\n=oyp3\r\n-----END PGP SIGNATURE-----\r\n","size":4834},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_1.0.3_1664074491257_0.9287169395409789"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-09-25T02:54:58.951Z","contributors":[]},"2.0.0":{"name":"csrf-sync","version":"2.0.0","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/cjs/index.cjs","exports":{".":{"require":"./lib/cjs/index.cjs","import":"./lib/esm/index.js"}},"types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:cjs":"tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs","build:esm":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:esm && npm run build:cjs","build:clean":"npm run clean && npm run build","pack":"npm pack","pack:clean":"rm -rf *.tgz && npm run pack"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/express":"^4.17.14","@types/express-session":"^1.17.5","@types/http-errors":"^1.8.2","@typescript-eslint/eslint-plugin":"^5.38.0","@typescript-eslint/parser":"^5.38.0","chai":"^4.3.6","eslint":"^8.23.1","mocha":"^10.0.0","prettier":"^2.7.1","ts-node":"^10.9.1","typescript":"^4.8.3"},"dependencies":{"@types/chai":"^4.3.3","@types/mocha":"^9.1.1","http-errors":"^2.0.0","package-lock.json":"^1.0.0","package.json":"^2.0.1"},"gitHead":"39c64eef1b8728bee13b398a1e5bedbeb4d2e0f2","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@2.0.0","_nodeVersion":"18.9.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-ykkaJFjU2T5m+mEd3a2flwyEo+q5GB8P1cSCnKdoatF6ljcfoTmwBe4w4QfdKtkx5tNx73iBpctgtVF0Rq+AOQ==","shasum":"50be69f41217f9608aed40294fd1f6f1368c3e30","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-2.0.0.tgz","fileCount":6,"unpackedSize":14650,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDU6A46sKuLbT6KQMieexFZjpbNeBEregc10esL20MVQwIhAPW6wYoTg+BohyuEbi4IRqdmMbtLFRCNC22kNM66xC63"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjQDUCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmozMw//eiGqvF8/edrrdkeaqSgbwqi2S4/BE49wdk8xuGD4yg5GC8Oi\r\nz3pNUEn/9ET4yVBN5pJ0fm/ocJE+QMUTbqpkTwXmOIcriqUq/cn9+u3d5Dp3\r\nTkf7NVmfI0UDEv6ahkb0QaQaTW3LbYXM/oR8nNLX2hUnEmE+zs/qbIqsK5G2\r\nuykSp8EbBMHhpQnW3wtljZkFjOKWfgay75m8SAT9sq32ap6ENTQUsoEQ3hY0\r\n3TX0nRniRVRDAbG9ISelwJgFXiaM615s3DFAemO6XdOnu+hHDEZpS6kNr3r1\r\nagPAaVA0sa3NbHoTU1bH8N/vZ7+Hinuhb2zVher4V5Duf7GzMj3MUJbYax5v\r\nb2j8PsMP0z5vfCi8f95vrp0KKj00/f4GoerHwWXnNKhz1Wz4+cKktyOmXHRc\r\nrIDDwvi9smwugIstFAkGzi28eg5At5QjiuuvxBLW8KG65LbUmKjkXY5zr9tt\r\nsd+D/RV1uGi7NlRrCqPgadiHtkEY64ApnPBbFYNPZ+EWOmg+eoYA6dCoD/6f\r\nmhVe60zsUAgNzf9poUS/SsHP24rz/nUnNkC/4Dr3ieQGx/+cL+Ic7iiIs/zv\r\nsh5T8QxnAggb52rmkJeK2kMSvbFQWoGE5qwFXBAlBfLmqCwbBbDab09OOEwS\r\n8cxe5cWRnssUxv5zNBtyhCahJHjYQWAF2ms=\r\n=XLY+\r\n-----END PGP SIGNATURE-----\r\n","size":5042},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_2.0.0_1665152258721_0.605313878257548"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-10-07T14:17:51.463Z","contributors":[]},"2.0.1":{"name":"csrf-sync","version":"2.0.1","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/cjs/index.cjs","exports":{".":{"require":"./lib/cjs/index.cjs","import":"./lib/esm/index.js"}},"types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:cjs":"tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs","build:esm":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:esm && npm run build:cjs","build:clean":"npm run clean && npm run build","pack":"npm pack","pack:clean":"rm -rf *.tgz && npm run pack"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/chai":"^4.3.3","@types/express":"^4.17.14","@types/express-session":"^1.17.5","@types/http-errors":"^1.8.2","@typescript-eslint/eslint-plugin":"^5.38.0","@types/mocha":"^9.1.1","@typescript-eslint/parser":"^5.38.0","chai":"^4.3.6","eslint":"^8.23.1","mocha":"^10.0.0","prettier":"^2.7.1","ts-node":"^10.9.1","typescript":"^4.8.3"},"dependencies":{"http-errors":"^2.0.0"},"gitHead":"e415f9387b9dbb6e542a846c09128959b41e21ad","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@2.0.1","_nodeVersion":"18.9.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-ajy6jn+Qu6cY5gINBdlAZbdq+1mmpjvP87etEu8wyMhJkMmK77p8nOaE82eNq9tlPYKLm2mwNENWOcOkbO8akg==","shasum":"47e78498adde48e5642e1b795f6b7cdb1dd22baf","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-2.0.1.tgz","fileCount":6,"unpackedSize":14585,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF+kuFrD+FibpqxdAkm/mfclLgaMbuXBXt6LHfukk3oWAiBDVQgQ7q7X3t2GNVTCLAKHL2soXBcGB/RAGwHtY8T60Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjV6jCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcmQ//cAoChNV808Tr94Ny+UqQEphlf32XuSg8/0CKftvUqPptIT1t\r\n4H4XqzgQCr8GXsyz4vee6Zli/jRWEGoi3pERsguY6Xt4dhNhWz2ie2lolk3P\r\nO2HtlHCuX/iaeNcy1Az79c54W0TY7BNUNrI/Ie2NnXyfHOBBi5Ilscxq7yS+\r\nLtp6bGO+vfX3sM3NjEAp7gdlh6jku5mdAXOLG6+HPwCYHynK2SiykutI6hvJ\r\nbkojpFVwXcoStby7cDzDBeG8F9jQnOaakFvq4m2nEp++kv6+Ex3lrPOALec4\r\nSHfjyCcfkhbxtEeSoWXDCIDmzXdLfsM/b51i+FJL1QI8MRO7qfqj0adLasYg\r\nmmC6cbqIUi3dtzU/Fv1jCW0yslrVrbgRU9KsUhQ+IiuXkgkiytn38VxCMR3p\r\n65OX1OXFG24FOYWkihq3izmR+SVLRstSBtT0T+1r3DQOPXk7Mls5vWqSYO6r\r\nwSq1XFg421BwDV1PEj2o1l2EsCNDY1oP/o/ZCgpz6fVA+9Kejxbj0fFs0GiE\r\nZZ4Bf0v22r4GEEwkTgAgxjOY/Tzca/snlTonPrFru4pSP4m7aXFho3zN5nhj\r\n8tEByGtryUr3GmTZ8I1Vmw2dIXn6Os0YqRPcD1fG2//tY7XUuy+E/3qoaMHZ\r\nk6FxK527TkJQiCDfuEYNZQkbllnZNnmSwxU=\r\n=y6aL\r\n-----END PGP SIGNATURE-----\r\n","size":5025},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_2.0.1_1666689217807_0.8271916846629421"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-10-25T10:16:57.281Z","contributors":[]},"3.0.0":{"name":"csrf-sync","version":"3.0.0","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/cjs/index.cjs","exports":{".":{"require":"./lib/cjs/index.cjs","import":"./lib/esm/index.js"}},"types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:cjs":"tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs","build:esm":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:esm && npm run build:cjs","build:clean":"npm run clean && npm run build","pack":"npm pack","pack:clean":"rm -rf *.tgz && npm run pack"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/chai":"^4.3.3","@types/express":"^4.17.14","@types/express-session":"^1.17.5","@types/http-errors":"^1.8.2","@typescript-eslint/eslint-plugin":"^5.38.0","@types/mocha":"^9.1.1","@typescript-eslint/parser":"^5.38.0","chai":"^4.3.6","eslint":"^8.23.1","mocha":"^10.0.0","prettier":"^2.7.1","ts-node":"^10.9.1","typescript":"^4.8.3"},"dependencies":{"http-errors":"^2.0.0"},"gitHead":"784e76e8fa7cb2dea9f9b8d9635fb3821d8063aa","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@3.0.0","_nodeVersion":"18.9.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-PAYHYdOSiTOxujT8H+wnYy+QE+LFgidv7aPsTjkWmuR0BBeQPbJQ7MfCDgjpmAluD3zDc+ZN1x0XWGwdpebiNQ==","shasum":"913e01b0b87dc8eec398084a01c4c7f06b5b186b","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-3.0.0.tgz","fileCount":6,"unpackedSize":16569,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3LW7PP7S8UtAwPQu4Wgu+ZYQKc0q2JesBoTn9w0VG8AIhAOx03Ltc7G07wqN3OZiwoWcA6GGYvlgtvgF+qZIKv8Cg"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjd2WCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrImg//c1XfeQh3Q+tPYe3diOcYpfZDOtl1QBEJA4ezL36tCxkvxGK2\r\n83Lr2AV14Plm6yhtsQpWdJxWnWHRbMIq/KRkzlU+cjP/okU0nsqiGpBpl37Y\r\n5K+Gt5z2Hq0DkgmxJbhvknOSsk1mqpJevLIz9pQdBaKtP5X9QMuIT7OZFWLq\r\nZm7gVtpF9ArI7QtYdK1enlsVAQWKOfoK9arwq5CIpO/agHxod5Xp8PYFb39a\r\nH1FR75tpNFPfZ74jFrQwf9Vi5Hzg3KZPZcr9YXomz8TmScDydtZx8Ww3KX6s\r\nMjz8ca56L7Y/8rvLMK3/oU1ZKntPwAl9oDNawqutTRyZ/lm16ud/I55PUa95\r\n7PnSewYvhyg0ScCpMTS6lRsdJolO0PP3N4D4TodfgLVAXquYqIlLIunwE7xX\r\nj8QCYbY40yMqv8TdJKw+jYmogBt42gS+wa+eYgK735/2+PNEkUZkyrqkvpWX\r\nY9IN4xOFQFyoswu+RrKxX76zEEzL2aHCcpFfuAxwHVgT0dxEhtIhzpwNjJ+7\r\nsHNLEzixXGGv+sIbfTFdw+3uv7iOChyIaaKdEb10FyCE8YrK23eL2ejCaPZ2\r\nBHlLm+LIWqAeUq7SOvz/q1yTq1zdmVFHo5MM9gR8qP3pCxOe6CZ00j6fEyG3\r\ncr5hzt3NyIT4sli7lKJF84piGx3sczF8kR8=\r\n=YLfO\r\n-----END PGP SIGNATURE-----\r\n","size":5524},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_3.0.0_1668769154132_0.5905207852158214"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-11-18T11:12:52.689Z","contributors":[]},"3.1.0":{"name":"csrf-sync","version":"3.1.0","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/cjs/index.cjs","exports":{".":{"require":"./lib/cjs/index.cjs","import":"./lib/esm/index.js"}},"types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:cjs":"tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs","build:esm":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:esm && npm run build:cjs","build:clean":"npm run clean && npm run build","pack":"npm pack","pack:clean":"rm -rf *.tgz && npm run pack"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/chai":"^4.3.3","@types/express":"^4.17.14","@types/express-session":"^1.17.5","@types/http-errors":"^1.8.2","@typescript-eslint/eslint-plugin":"^5.38.0","@types/mocha":"^9.1.1","@typescript-eslint/parser":"^5.38.0","chai":"^4.3.6","eslint":"^8.23.1","mocha":"^10.0.0","prettier":"^2.7.1","ts-node":"^10.9.1","typescript":"^4.8.3"},"dependencies":{"http-errors":"^2.0.0"},"gitHead":"760f6b7d346898a1c699b7505d9a38b8c45e28dc","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@3.1.0","_nodeVersion":"18.9.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-kRIG2llOM8WElJXvzQvIDGyvmJmmzADhBgMXag9qBkgIhXkgM2ts+14CP+MJ8MD1igReNrBLTkevXsat2+7B5w==","shasum":"83d95fcb440b843be56fc7bf65c74eee806ead00","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-3.1.0.tgz","fileCount":6,"unpackedSize":17370,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA55jdgf9h7yL+jXxp+4uNvYV38y09sE/4xzHvoXnfA1AiBknr/d15WN+DzH7fR/dtpeROKXf5iRa23KA4tlCPAhuQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuVFuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmosOg/9HDYfA3AUrkGIrDlxIrpXhGQwZyLK9J64C5FurI//okn4VFek\r\nM1AG8rKr236Ms3i7pRqXBC82uuj83pIIYzVEtY2N3H1/mq3F35BB3TfDmXtT\r\nX8sHqOrQXob4Jju8KzvnOomwKO5HN/Bvm0ysyUQDu1NPI7YDB6Bh6zAthUjA\r\nJNPAcA9XcxcFCGb5keodYSMwcTgsondszV+ndrQW5FKcUhm8zGalRSScTYfQ\r\nromIY9hFW84IW+AersJ+Q77NyWaeZZPjiiTHGn2Pljwb1RC044gkScO/ezFq\r\naQVPMpxf9tndkKdSp1TeXLgv+7xGpWoya+sjG38P/o4tWi9u2mVI7iw+jLL8\r\nGQJp529vIBHPc699FFB71HsECpf5nclaE9hq/FMjLku1NaJL4zjpPhTq/9uE\r\neJwULULntJNluAvF0kYWTQkMQjqi/lKCSQEnKIvf/iL/IW0naMpxt164clFc\r\nX7Maov4WFshr+D+6cKEcZq2Q3bcUDxiRsrLwENswJ//QiEL6kaDDoCWPc7ff\r\nTiI8KLZ6K0YaPkB10h1mISuIm24JIfTSQ04Z8uOvKpYOiDS09BVLyx+P2s/g\r\nGlNO8TNg4CxQ8U3JC8kKAYx1TRXWXtdzzGVP1tdCx51Ey9xRA0vHCrszKIHU\r\nhK6Gf5kZYEljLcAoavdzozf6CGTCcLj7QR0=\r\n=4yuA\r\n-----END PGP SIGNATURE-----\r\n","size":5694},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_3.1.0_1673089390281_0.7924581882442177"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-07T11:03:15.834Z","contributors":[]},"4.0.0":{"name":"csrf-sync","version":"4.0.0","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/cjs/index.cjs","exports":{".":{"require":"./lib/cjs/index.cjs","import":"./lib/esm/index.js"}},"types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:cjs":"tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs","build:esm":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:esm && npm run build:cjs","build:clean":"npm run clean && npm run build","pack":"npm pack","pack:clean":"rm -rf *.tgz && npm run pack"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/chai":"^4.3.3","@types/express":"^4.17.14","@types/express-session":"^1.17.5","@types/http-errors":"^1.8.2","@typescript-eslint/eslint-plugin":"^5.38.0","@types/mocha":"^9.1.1","@typescript-eslint/parser":"^5.38.0","chai":"^4.3.6","eslint":"^8.23.1","mocha":"^10.0.0","prettier":"^2.7.1","ts-node":"^10.9.1","typescript":"^4.8.3"},"dependencies":{"http-errors":"^2.0.0"},"gitHead":"5cd9a28cdb794822863c4d3e64cbe165ff9b5afd","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@4.0.0","_nodeVersion":"18.9.0","_npmVersion":"8.0.0","dist":{"integrity":"sha512-io4hL5CNIYC/OyEJb2xj32rmnNFMNJ3zU94pA2kh6IoDo26mF3VyeUhx4/29GC/r1/LmL+zhEYzTMCUHjmFKEg==","shasum":"e951f1088bc896ad7e8539fccf685bc777002fff","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-4.0.0.tgz","fileCount":6,"unpackedSize":18680,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDtJWH2ujdtJEKjWm0O3ZOb3VK05t+9dx97/TGMAAG7VAiEA4Z46JWqDo3Vri5xaqyEPI2iySEApj+o++TOOFa4Ps0A="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj1j66ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrAbRAAg7IiikYYVCQseuJiNu+mORvMw9+hMA54UP3ptKfnRgxntczz\r\n7bQLOBcK8e7cDJQc+jjpHKFV9vqt/74oXA8iuN4hD8nv4qlz7gi/9R4uDusn\r\nLC4pehmwzmnweOoOpAqeTRZSM/rcEU1hGcWfVfo5+sFRyn7VjeBmjBZ/oySP\r\nx4zRzKDuB9OuGLi//HqLnOi0A4nVgabqULOFw2nf5HqXecxzusg7Hpppd54D\r\nsdvQBppN4e5J9ee5XRtGiTOcYWxMfiEo/OqTBbx2I3x1W/AlZeS+tJ4Na63A\r\nSn8TOeb6JITezmXmTXJDWw4Sf+FN7CPES8nFhdfX3fX1/dmAR+8Xa9f8Ar8U\r\n1ecLxsptB04nuJsuqqr63AdKpd7sCZ1ekTNy3vuynYQqHr+I9IafZOGZZsz3\r\n2L/zIeLEDquoz/tNKIwStUjBnnanLDaHh8zzcbS5d9V4Yz26BTRbz/fSERia\r\nqX9XHbtZfAi8kAyTC1kcLHux5uK/jxtnpnydFMeYG4w+/wLAV1od8ZDqevmm\r\npyyfV3bt4hIVUBUSnCLGvx5xgb5MKUjcKvvx/LxkyuowUk7/PirnxK6ZtfA0\r\n6n+qIKBQuOkzLPYozbPUCgo6bBoHJpDF5kv6tc2UaiaLTzmw2I5/wwEMpyCj\r\n0B4z2DmtEc0hmer6op6FogusCoCfybPHO9k=\r\n=wQWE\r\n-----END PGP SIGNATURE-----\r\n","size":6196},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_4.0.0_1674985146183_0.2765849070573514"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-29T09:39:06.358Z","publish_time":1674985146358,"contributors":[]},"4.0.1":{"name":"csrf-sync","version":"4.0.1","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/cjs/index.cjs","exports":{".":{"require":"./lib/cjs/index.cjs","import":"./lib/esm/index.js"}},"types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:cjs":"tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs","build:esm":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:esm && npm run build:cjs","build:clean":"npm run clean && npm run build","pack":"npm pack","pack:clean":"rm -rf *.tgz && npm run pack"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/node":"^18.15.8","@types/chai":"^4.3.4","@types/express":"^4.17.17","@types/express-session":"^1.17.7","@types/http-errors":"^2.0.1","@typescript-eslint/eslint-plugin":"^5.56.0","@types/mocha":"^10.0.1","@typescript-eslint/parser":"^5.56.0","chai":"^4.3.7","eslint":"^8.36.0","mocha":"^10.2.0","prettier":"^2.8.7","ts-node":"^10.9.1","typescript":"^5.0.2"},"dependencies":{"http-errors":"^2.0.0"},"gitHead":"71b71a2d4fd702fae548036b5ddb4104a95fb96a","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@4.0.1","_nodeVersion":"18.14.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-qg13VGDAfkz7YNCTQ/6+mo3IzndZQNkfGjDQmvGwmVVUrIS9NHe3vDSCP83WpQAzJS4dFwPVII52i3E5jM8vGw==","shasum":"70019806fc4aefec761d169383ec0a76ef7c2604","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-4.0.1.tgz","fileCount":6,"unpackedSize":19320,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEIMC+9rhssiixDEDM761369Zj6p2Gvs2T1gtdMhmL5JAiEAuLdMGHx4kMt5yOlgnhd09ZzcQ0JUXgk4+c9YLXv5sag="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHnHyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/7g/+MBrSnf+ujhCP+TfnB91Hlp4hupffqsBUle4IB44n/tiq476u\r\n8vzcc5l01uecO0MX3LMJlT3lkF4oKdon1V5BADzDOzk0wy2ws5S1SAOjd/tb\r\n4XfIv3JE74tu7arNxJdFP/+tL8KF0K+VlrNuw63/Ihh2ZmoQXLDeK7DKK2Uo\r\nXZlVtD5d2iix/4+qzKlAkXKc4/w3sCb1hjI2Py05Mh+KaWHcsJkOo8JiaXJy\r\njSxwFvofo7joHfHcBmp1VwpTmFyX9sVfegjB0J6iQMmFa6+7Fj46VoG7Q6yr\r\nI7UWeuZfNw7DlJwxbxvWQDx7UdwjJa+mQcbVmPjvuP8sIKHJvUq1hChNeWTu\r\nFrhmRu4LOeby2FOrzwgxorYkU86O1bQkUdSlr9E7WhS47iLlTlvorolxJsQu\r\n/335lnnm+v7OG2yqf2bBnJEqE/01rCj41GyCw7+7lPR+Hk5Y/gkZHUaGAU5Y\r\ngD72TKlFWDFnO/DeXrDGDgQcj0OuvOnXvfA0AtBwipL82JijiRWIFiukq1CA\r\ndvla5zjaglXmEdslFpf3ZYbMGdGMFAbkzMcpIdddASNKx76tHKsZ0i90fwfP\r\nzdajLplljoXOfc9x24US3dyWDEMrtmMdLeD7uKTid3UbkjAXQd/t/0XfFkSj\r\n5Rf3Qy8rt2ViOhptlpBYYCFG0nm0NqaVMeY=\r\n=Gd7B\r\n-----END PGP SIGNATURE-----\r\n","size":6366},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_4.0.1_1679716850260_0.864242096636078"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-03-25T04:00:50.483Z","publish_time":1679716850483,"contributors":[]},"4.0.3":{"name":"csrf-sync","version":"4.0.3","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/cjs/index.cjs","exports":{"require":{"types":"./lib/index.d.cts","default":"./lib/cjs/index.cjs"},"import":{"types":"./lib/index.d.ts","import":"./lib/esm/index.js"}},"types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:cjs":"tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs && cp ./lib/index.d.ts ./lib/index.d.cts","build:esm":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:esm && npm run build:cjs","build:clean":"npm run clean && npm run build","pack":"npm pack","pack:clean":"rm -rf *.tgz && npm run pack"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/node":"^18.15.8","@types/chai":"^4.3.11","@types/express":"^4.17.21","@types/express-session":"^1.17.10","@types/http-errors":"^2.0.4","@typescript-eslint/eslint-plugin":"^6.14.0","@types/mocha":"^10.0.6","@typescript-eslint/parser":"^6.14.0","chai":"^4.3.10","eslint":"^8.56.0","mocha":"^10.2.0","prettier":"^3.1.1","ts-node":"^10.9.2","typescript":"^5.3.3"},"dependencies":{"http-errors":"^2.0.0"},"gitHead":"8f706daabac190794cf6fdebe7ca76bf9da15b18","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_id":"csrf-sync@4.0.3","_nodeVersion":"18.14.1","_npmVersion":"8.0.0","dist":{"integrity":"sha512-wXzltBBzt/7imzDt6ZT7G/axQG7jo4Sm0uXDUzFY8hR59qhDHdjqpW2hojS4oAVIZDzwlMQloIVCTJoDDh0wwA==","shasum":"3bc629a2c080d2291479f55d5bfa58edf9af6078","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-4.0.3.tgz","fileCount":7,"unpackedSize":21725,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC6EA2GQE724Y6tU0B99X36L5cnSqBLEbKFRt1/rw6rTAiEAkUjikSUuPQekX0TWZB9ScS59iSHlVWz4KibrZEuFk4c="}],"size":6605},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/csrf-sync_4.0.3_1702714890497_0.3763051907423842"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-12-16T08:21:30.677Z","publish_time":1702714890677,"_source_registry_name":"default","contributors":[]},"4.1.0":{"name":"csrf-sync","version":"4.1.0","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/cjs/index.cjs","exports":{"require":{"types":"./lib/index.d.cts","default":"./lib/cjs/index.cjs"},"import":{"types":"./lib/index.d.ts","import":"./lib/esm/index.js"}},"types":"./lib/index.d.ts","scripts":{"test":"mocha --recursive ./src/tests/*.test.ts","clean":"rm -rf ./lib","lint":"npx eslint .","prettify":"npx prettier --write .","build:types":"tsc --declaration --outDir ./lib --emitDeclarationOnly","build:cjs":"tsc -p tsconfig.cjs.json && mv ./lib/cjs/index.js ./lib/cjs/index.cjs && cp ./lib/index.d.ts ./lib/index.d.cts","build:esm":"tsc -p tsconfig.json","build":"npm run build:types && npm run build:esm && npm run build:cjs","build:clean":"npm run clean && npm run build","pack":"npm pack","pack:clean":"rm -rf *.tgz && npm run pack"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@types/chai":"^4.3.11","@types/express":"^4.17.21","@types/express-session":"^1.17.10","@types/http-errors":"^2.0.4","@types/mocha":"^10.0.6","@types/node":"^18.15.8","@typescript-eslint/eslint-plugin":"^6.14.0","@typescript-eslint/parser":"^6.14.0","chai":"^4.3.10","commit-and-tag-version":"12.5.0","eslint":"^8.56.0","mocha":"^10.2.0","prettier":"^3.1.1","ts-node":"^10.9.2","typescript":"^5.3.3"},"dependencies":{"http-errors":"^2.0.0"},"_id":"csrf-sync@4.1.0","gitHead":"55747902c7ff30120f0e922181c70c64e8f3408e","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_nodeVersion":"20.11.1","_npmVersion":"10.9.1","dist":{"integrity":"sha512-bEA+AwaBbXkf6k4UHg0JGuGpuVs+HiOX4KjoZmbvxIhtKl+8ND7OOElgbaR59qSPtvfvXIyCnmAPYzsND+EZhA==","shasum":"2561a417d4558aa3b0c0495be80066037cae1f23","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-4.1.0.tgz","fileCount":7,"unpackedSize":22961,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD32LAAaXMc586fg9TvV7KmuKLIA75CBIq27s8DKaQI2wIgV3Za8dHJGtCyS3XCJB7ErYW0S+jPK3iS4zVX4NZo2KE="}],"size":6898},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/csrf-sync_4.1.0_1742692053337_0.7569494266604362"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-03-23T01:07:33.519Z","publish_time":1742692053519,"_source_registry_name":"default","contributors":[]},"4.2.0":{"name":"csrf-sync","version":"4.2.0","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/index.cjs","exports":{"require":{"types":"./lib/index.d.cts","default":"./lib/index.cjs"},"import":{"types":"./lib/index.d.ts","import":"./lib/index.js"}},"types":"./lib/index.d.ts","scripts":{"clean":"rm -rf ./lib","lint":"biome check .","lint:fix":"biome check --write .","build":"tsup","build:clean":"npm run clean && npm run build","changelog":"commit-and-tag-version","pack:clean":"rm -rf *.tgz && npm pack","test":"vitest run","test:coverage":"vitest run --coverage"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@biomejs/biome":"1.9.4","@types/express":"^4.17.21","@types/express-session":"^1.18.0","@types/http-errors":"^2.0.4","@types/node":"^18.15.8","@vitest/coverage-istanbul":"3.1.2","commit-and-tag-version":"12.5.0","tsup":"8.4.0","typescript":"^5.3.3","vitest":"3.1.2"},"dependencies":{"http-errors":"^2.0.0"},"_id":"csrf-sync@4.2.0","gitHead":"8308035dbafe0225811eab2e071abdd489899e4a","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_nodeVersion":"20.11.1","_npmVersion":"10.9.1","dist":{"integrity":"sha512-WdxMehlhL1dB7qnkyXM90GEU4M1ovwvxrZk6mtP7PD32Uw0j01AP6hgTPl6iBqKaMX/Os0NnLWHi8shYw8Idzw==","shasum":"3b182a09dc42c9d1900c2a3d0c97a9d5088e5e53","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-4.2.0.tgz","fileCount":7,"unpackedSize":25511,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC9y3bWLFsQe6KoLcHTiunvMGK6ZO7ugQko0L1kfAVhyQIgEtNeWM39r9Fwpjdf2txQ408PjzkAF85OO5KiZyNQL8c="}],"size":7821},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/csrf-sync_4.2.0_1746010466536_0.5790767716466894"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-04-30T10:54:26.708Z","publish_time":1746010466708,"_source_registry_name":"default","contributors":[]},"4.2.1":{"name":"csrf-sync","version":"4.2.1","description":"A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.","type":"module","main":"./lib/index.cjs","exports":{"require":{"types":"./lib/index.d.cts","default":"./lib/index.cjs"},"import":{"types":"./lib/index.d.ts","import":"./lib/index.js"}},"types":"./lib/index.d.ts","scripts":{"clean":"rm -rf ./lib","lint":"biome check .","lint:fix":"biome check --write .","build":"tsup","build:clean":"npm run clean && npm run build","changelog":"commit-and-tag-version","pack:clean":"rm -rf *.tgz && npm pack","test":"vitest run","test:coverage":"vitest run --coverage"},"author":{"name":"psibean"},"license":"ISC","homepage":"https://github.com/Psifi-Solutions/csrf-sync","repository":{"type":"git","url":"git+https://github.com/Psifi-Solutions/csrf-sync.git"},"keywords":["csrf","middleware","express","tokens"],"devDependencies":{"@biomejs/biome":"1.9.4","@types/express":"^4.17.21","@types/express-session":"^1.18.0","@types/http-errors":"^2.0.4","@types/node":"^18.15.8","@vitest/coverage-istanbul":"3.1.2","commit-and-tag-version":"12.5.0","tsup":"8.4.0","typescript":"^5.3.3","vitest":"3.1.2"},"dependencies":{"http-errors":"^2.0.0"},"_id":"csrf-sync@4.2.1","gitHead":"b1b2a4d766409f3d08db06a8d4d9a2eec0d71937","bugs":{"url":"https://github.com/Psifi-Solutions/csrf-sync/issues"},"_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-+q9tlUSCi/kbwr1NYwn5+MeuNhwxz3wSv1yl42BgIWfIuErZ3HajRwzvZTkfiyIqt1PZT8lQSlffhSYjCneN7g==","shasum":"cadfbd3b9b401a09c1a29afe5e6dabb0f7a3e5d4","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/csrf-sync/-/csrf-sync-4.2.1.tgz","fileCount":7,"unpackedSize":26215,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDnqy1etBMChU6w2FugtlFQzA/0L9QRmvQzyDd58tNhnQIhAIwTEaAQPnPJxHJg29u4SMP5AUf5hJ8ZlpQrF179UBm3"}],"size":7884},"_npmUser":{"name":"anonymous","email":"psionatix@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"psionatix@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/csrf-sync_4.2.1_1746855040109_0.577500522209816"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-05-10T05:30:40.297Z","publish_time":1746855040297,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"4.2.1"},"name":"csrf-sync","time":{"created":"2022-09-24T04:58:39.295Z","modified":"2025-05-15T02:42:45.291Z","1.0.0":"2022-09-24T04:57:24.830Z","1.0.1":"2022-09-24T05:41:40.920Z","1.0.2":"2022-09-24T06:11:45.637Z","1.0.3":"2022-09-25T02:54:51.469Z","2.0.0":"2022-10-07T14:17:38.949Z","2.0.1":"2022-10-25T09:13:38.034Z","3.0.0":"2022-11-18T10:59:14.277Z","3.1.0":"2023-01-07T11:03:10.459Z","4.0.0":"2023-01-29T09:39:06.358Z","4.0.1":"2023-03-25T04:00:50.483Z","4.0.3":"2023-12-16T08:21:30.677Z","4.1.0":"2025-03-23T01:07:33.519Z","4.2.0":"2025-04-30T10:54:26.708Z","4.2.1":"2025-05-10T05:30:40.297Z"},"readme":"<h1 align=\"center\">\n  CSRF Sync\n</h1>\n\n<h4 align=\"center\">A utility package to help implement stateful CSRF protection using the Synchroniser Token Pattern in express.</h4>\n\n<p align=\"center\">\n  <a href=\"https://www.npmjs.com/package/csrf-sync\">\n    <img src=\"https://img.shields.io/npm/v/csrf-sync\" />\n  </a>\n  <a href='https://coveralls.io/github/Psifi-Solutions/csrf-sync?branch=main'><img src='https://coveralls.io/repos/github/Psifi-Solutions/csrf-sync/badge.svg?branch=main' alt='Coverage Status' /></a>\n  <a href=\"https://discord.gg/JddkbuSnUU\">\n    <img src=\"https://discordapp.com/api/guilds/643569902866923550/widget.png?style=shield\">\n  </a>\n    <a href=\"https://ko-fi.com/G2G813S7A0\">\n    <img width=\"150px\" src=\"https://ko-fi.com/img/githubbutton_sm.svg\" />\n  </a>\n</p>\n\n<p align=\"center\">\n  <a href=\"#getting-started\">Getting Started</a> •\n  <a href=\"#configuration\">Configuration</a> •\n  <a href=\"./FAQ.md\">FAQ</a> •\n  <a href=\"#support\">Support</a>\n</p>\n\n<h2 id=\"background\">Background</h2>\n\n<p>\n  This module intends to provide the necessary pieces required to implement CSRF protection using the <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#synchronizer-token-pattern\">Synchroniser Token Pattern</a>. This means you will require server side state, if you require stateless CSRF protection, please see <a href=\"https://github.com/Psifi-Solutions/csrf-csrf\">csrf-csrf</a> for the <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#double-submit-cookie\">Double-Submit Cookie Pattern</a>.\n</p>\n\n<p>\n  Since <a href=\"https://github.com/expressjs/csurf\">csurf</a> has been deprecated I struggled to find alternative solutions that were accurately implemented and configurable, so I decided to write my own! A lot of CSRF protection based packages often try to provide a full solution, or they only provide the Double-Submit Cookie method, and in doing so, they become rather complicated to configure. So much so, that your configuration alone could render the protection completely useless.\n</o>\n\n<p>\n  This is why <code>csrf-sync</code> aims to provide a single and targeted implementation to simplify it's use.\n</p>\n\n<h2 id=\"getting-started\">Getting Started</h2>\n<p>\n  This section will guide you through using the default setup, which does sufficiently implement the Synchronised Token Pattern. Be sure to check the <a href=\"./FAQ.md\">FAQ</a> as it can help you determine whether you need CSRF protection, and if  you do, whether <code>csrf-sync</code> is an appropriate choice, as well as provide insight on how to use it appropriately. If you would like to customise the configuration, see the <a href=\"#configuration\">configuration</a> section, whenever you change a configuration, you should ensure you understand the impact of the change.\n</p>\n<p>\n  You will need to be using <a href=\"https://github.com/expressjs/session\">express-session</a> (or a session middleware which provides a <code>request.session</code> property). this utility will add a <code>csrfToken</code> property to <code>request.session</code>.\n</p>\n\n```\nnpm install express express-session csrf-sync\n```\n\n```js\n// ESM\nimport { csrfSync } from \"csrf-sync\";\n// CommonJS\nconst { csrfSync } = require(\"csrf-sync\");\n```\n\n```js\nconst {\n  invalidCsrfTokenError, // This is just for convenience if you plan on making your own middleware.\n  generateToken, // Use this in your routes to generate, store, and get a CSRF token.\n  getTokenFromRequest, // use this to retrieve the token submitted by a user\n  getTokenFromState, // The default method for retrieving a token from state.\n  storeTokenInState, // The default method for storing a token in state.\n  revokeToken, // Revokes/deletes a token by calling storeTokenInState(undefined)\n  csrfSynchronisedProtection, // This is the default CSRF protection middleware.\n} = csrfSync();\n```\n\n<p>\n  This will extract the default utilities, you can configure these and re-export them from your own module. For handling the CSRF token see <a href=\"./FAQ.md#how-should-the-csrf-token-be-transmitted\">\"How should the CSRF token be transmitted?\"</a> from the FAQ.\n</p>\n<p>\n  You may need to create your own route(s) for generating and retrieving a token. For example, a JSON endpoint which you can call before making form submissions:\n</p>\n\n```js\nconst myRoute = (req, res) => res.json({ token: generateToken(req) });\nconst myProtectedRoute = (req, res) =>\n  res.json({ unpopularOpinion: \"Game of Thrones was amazing\" });\n```\n\nYou can also put the token into the context of a templated HTML response. Note in this case, the route is a <code>GET</code> request, and these request types are not protected (ignored request method), as they do not need to be protected so long as the route is not exposing any sensitive or sideeffect actions.\n\n```js\n// Make sure your session middleware is registered before these\nexpress.use(session);\nexpress.get(\"/csrf-token\", myRoute);\nexpress.use(csrfSynchronisedProtection);\n// Anything registered after this will be considered \"protected\"\n```\n\n<p>\n  You can also protect your routes on a case-to-case basis:\n</p>\n\n```js\napp.get(\"/secret-stuff\", csrfSynchronisedProtection, myProtectedRoute);\n```\n\nOnce a route is protected, you will need to include the most recently generated token in the `x-csrf-token` request header, otherwise you'll receive a `403 - ForbiddenError: invalid csrf token`.\n\n<h3>generateToken</h3>\n\n<p>By default if a token already exists on the session object, <code>generateToken</code> <b>will not overwrite it</b>, it will simply return the existing token. If you wish to force a token generation, you can use the second parameter:<p>\n\n```js\ngenerateToken(req, true); // This will force a new token to be generated, even if one already exists\n```\n\n<p>Instead of importing and using <code>generateToken</code>, you can also use <code>req.csrfToken</code> any time after the <code>csrfSynchronisedProtection</code> middleware has executed on your incoming request.</p>\n\n```js\nreq.csrfToken(); // same as generateToken(req) and generateToken(req, false);\nreq.csrfToken(true); // same as generateToken(req, true);\n```\n\n<h3>revokeToken</h3>\n\nBy default tokens <b>will NOT be revoked</b>, if you want or need to revoke a token you should use this method to do so. Note that if you call <code>generateToken</code> with <code>overwrite</code> set to true, this will revoke the any existing token and only the new one will be valid.\n\n<h2 id=\"configuration\">Configuration</h2>\n\n\n<h3 id=\"configuration-error-config\">errorConfig</h3>\n\n```ts\nstatusCode?: number;\nmessage?: string;\ncode?: string | undefined;\n```\n\n<p>\n  <b>Optional<br />\n  Default:</b>\n</p>\n\n```ts\n{\n  statusCode: 403,\n  message: \"invalid csrf token\",\n  code: \"EBADCSRFTOKEN\"\n}\n```\n\nUsed to customise the error response <code>statusCode</code>, the contained error <code>message</code>, and it's <code>code</code>, the error is constructed via <code>createHttpError</code>. The default values match that of <code>csurf</code> for convenience.\n\n\n<h3 id=\"get-token-from-request\">getTokenFromRequest</h3>\n\n```ts\n(req: Request) => string | null | undefined;\n```\n\n<p>\n  <b>Optional<br />\n  Default:</b>\n</p>\n\n```ts\n(req: Request) => req.headers[\"x-csrf-token\"];\n```\n\n<p>This function should return the token sent by the frontend, either in the request body/payload, or from the <code>x-csrf-token</code> header. <b>Do NOT</b> return the value from a cookie in this function, this would be the same as having no CSRF protection at all, see the <a href=\"./FAQ.md#how-should-the-csrf-token-be-transmitted\">\"How thould the csrf token be transmitted?\"</a> section of the FAQ.<p>\n\n\n<h3 id=\"get-token-from-state\">getTokenFromState</h3>\n\n```ts\n(req: Request) => string | null | undefined;\n```\n\n<p>\n  <b>Optional<br />\n  Default:</b>\n</p>\n\n```ts\n(req: Request) => req.session.csrfToken;\n```\n\n<p>This function should return the token from the backend state for the uniquely identified Request.</p>\n\n\n<h3>size</h3>\n\n```ts\nnumber;\n```\n\n<p>\n  <b>Optional<br />\n  Default:</b> <code>128</code>\n</p>\n\n<p>The size in bytes of the generated CSRF tokens.</p>\n\n\n<h3 id=\"skip-csrf-protection\">skipCsrfProtection</h3>\n\n```ts\n(req: Request) => boolean;\n```\n\n<p><b>Optional - Use this option with extreme caution*</b></p>\n\n<p>Used to determine whether CSRF protection should be skipped for the given request. If this callback is provided and the request is not in the <code>ignoredMethods</code>, then the callback will be called to determine whether or not CSRF token validation should be checked. If it returns <em>true</em> the CSRF protection will be skipped, if it returns <em>false</em> then CSRF protection will be checked.<p>\n\n<p>* It is primarily provided to avoid the need of wrapping the <code>csrfSynchronisedProtection</code> middleware in your own middleware, allowing you to apply a global logic as to whether or not CSRF protection should be executed based on the incoming request. You should <b>only</b> skip CSRF protection for cases you are 100% certain it is safe to do so, for example, requests you have identified as coming from a native app. You should ensure you are not introducing any vulnerabilities that would allow your web based app to circumvent the protection via CSRF attacks. This option is <b>NOT</b> a solution for CSRF errors.</p>\n\n\n<h3 id=\"store-token-in-state\">storeTokenInState</h3>\n\n```ts\n(req: Request, token?: CsrfSyncedToken) => void;\n```\n\n<p>\n  <b>Optional<br />\n  Default:</b>\n</p>\n\n```ts\n(req: Request, token: string) => {\n  req.session.csrfToken = token;\n}\n```\n\n<p>This function should store the token in the backend state for the uniquely identified Request.</p>\n\n\n<h2>Processing as a header</h3>\n\nWhen initialising <code>csrfSync</code>, you have a few options available for configuration, all of them are optional and have sensible defaults (shown below).\n\n```js\nconst csrfSyncProtection = csrfSync({\n  ignoredMethods = [\"GET\", \"HEAD\", \"OPTIONS\"],\n  getTokenFromState = (req) => {\n    return req.session.csrfToken;\n  }, // Used to retrieve the token from state.\n  getTokenFromRequest = (req) =>  {\n    return req.headers['x-csrf-token'];\n  }, // Used to retrieve the token submitted by the request from headers\n  storeTokenInState = (req, token) => {\n    req.session.csrfToken = token;\n  }, // Used to store the token in state.\n  size = 128, // The size of the generated tokens in bits\n});\n\n// NOTE THE VALUES ABOVE ARE THE DEFAULTS.\n// THE ABOVE IS THE SAME AS DOING:\n\nconst csrfSyncProtection = csrfSync();\n```\n\n<h2>Processing as a form</h3>\n\nIf you intend to use this module to protect user submitted forms, then you can use `generateToken` to create a token and pass it to your view, likely via template variables. Then using a hidden form input such as the example from the <a href=\"https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#synchronizer-token-pattern\">Cheat Sheet</a>.\n\n```html\n<form action=\"/transfer.do\" method=\"post\">\n  <input\n    type=\"hidden\"\n    name=\"CSRFToken\"\n    value=\"OWY4NmQwODE4ODRjN2Q2NTlhMmZlYWEwYzU1YWQwMTVhM2JmNGYxYjJiMGI4MjJjZDE1ZDZMGYwMGEwOA==\"\n  />\n  [...]\n</form>\n```\n\nUpon form submission a `csrfSync` configured as follows can be used to protect the form.\n\n```js\nconst { csrfSynchronisedProtection } = csrfSync({\n  getTokenFromRequest: (req) => {\n    return req.body[\"CSRFToken\"];\n  }, // Used to retrieve the token submitted by the user in a form\n});\n```\n\nIf using this with something like `express` you would need to provide/configure body parsing middleware before the CSRF protection.\n\nIf doing this per route, you would for example:\n\n```js\napp.post(\"/route/\", csrfSynchronisedProtection, async (req, res) => {\n  //process the form as we passed CSRF\n});\n```\n\n<h3>Safely Using both body and header</h3>\n\n```js\nconst { csrfSynchronisedProtection } = csrfSync({\n  getTokenFromRequest: (req) => {\n    // If the incoming request is a application/x-www-form-urlencoded content type\n    // then get the token from the body.\n    if (req.is(\"application/x-www-form-urlencoded\")) {\n      return req.body[\"CSRFToken\"];\n    }\n    // Otherwise use the header for all other request types\n    return req.headers[\"x-csrf-token\"];\n  },\n});\n```\n\n<h2>Using asynchronously</h2>\n\n<p><code>csrf-sync</code> itself will not support promises or async, <b>however</b> there is a way around this. If your CSRF token is stored externally and needs to be retrieved asynchronously, you can register an asynchronous middleware first, which exposes the token.</p>\n\n```js\n(req, res, next) => {\n  getCsrfTokenAsync(req)\n    .then((token) => {\n      req.asyncCsrfToken = token;\n      next();\n    })\n    .catch((error) => next(error));\n};\n```\n\n<p>And in this example, your `getTokenFromRequest` would look like this:</p>\n\n```js\n(req) => req.asyncCsrfToken;\n```\n\n<h2 id=\"support\">Support</h2>\n\n<ul>\n  <li>\n    Join the <a href=\"https://discord.gg/JddkbuSnUU\">Discord</a> and ask for help in the <code>psifi-support</code> channel.\n  </li>\n  <li>\n    Pledge your support through the <a href=\"\">Patreon</a>\n  </li>\n</ul>\n\n<a href=\"https://www.buymeacoffee.com/psibean\" target=\"_blank\"><img src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" ></a>","users":{}}