{"id":21521097,"url":"https://github.com/weisjohn/superagent-csrf-middleware","last_synced_at":"2025-04-09T22:21:43.687Z","repository":{"id":36197495,"uuid":"40501718","full_name":"weisjohn/superagent-csrf-middleware","owner":"weisjohn","description":"easily handle CSRF tokens with superagent","archived":false,"fork":false,"pushed_at":"2015-08-20T08:22:34.000Z","size":148,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:15:05.860Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weisjohn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-10T19:29:55.000Z","updated_at":"2024-06-22T02:57:47.000Z","dependencies_parsed_at":"2022-08-18T18:21:22.236Z","dependency_job_id":null,"html_url":"https://github.com/weisjohn/superagent-csrf-middleware","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fsuperagent-csrf-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fsuperagent-csrf-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fsuperagent-csrf-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weisjohn%2Fsuperagent-csrf-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weisjohn","download_url":"https://codeload.github.com/weisjohn/superagent-csrf-middleware/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248120243,"owners_count":21050915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T01:05:45.753Z","updated_at":"2025-04-09T22:21:43.657Z","avatar_url":"https://github.com/weisjohn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# superagent-csrf-middleware\n\neasily handle CSRF tokens with superagent\n\nSupports simple CSRF implementations and those which modify the token with each request.\n\n### usage\n\n```javascript\n\nvar request = require('superagent');\nvar csrf = require('superagent-csrf-middleware');\nvar agent = request(server);\n\nvar csrf1 = csrf();\nagent.get('/foo')\n    .use(csrf1)\n    .end(function() {\n        agent.post('/bar')\n            .use(csrf1)\n            .end(function() {\n                /* ... */\n            });\n    });\n```\n\n### options\n\nBy default, `superagent-csrf-middleware` looks at the `XSRF-TOKEN` cookie and sets the `X-XSRF-TOKEN` header. \n\nYou may optionally define other parameters:\n\n```javascript\nvar cookie = 'MY-XSRF-COOKIE-NAME';\nvar header = '_SEASURF';\nvar csrf = require('superagent-csrf-middleware')(cookie, header);\n```\n\n### support\n\nThis is known to work with [lusca](https://github.com/krakenjs/lusca)'s CSRF implementation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Fsuperagent-csrf-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweisjohn%2Fsuperagent-csrf-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweisjohn%2Fsuperagent-csrf-middleware/lists"}