2.2.0 • Published 3 months ago

frau-superagent-xsrf-token v2.2.0

Weekly downloads
690
License
Apache-2.0
Repository
github
Last release
3 months ago

frau-superagent-xsrf-token

NPM version Coverage Status

Superagent plugin to add XSRF tokens in a D2L free range application (frau).

Install

npm install frau-superagent-xsrf-token --save

Usage

var request = require('superagent'),
	xsrfToken = require('frau-superagent-xsrf-token');

request
	.post('/foo/bar')
	.use(xsrfToken)
	.end(function () {})

Note: XSRF tokens will only be added to requests to relative URLs.

Testing

npm test

Contributing

  1. Fork the repository. Committing directly against this repository is highly discouraged.

  2. Make your modifications in a branch, updating and writing new unit tests as necessary in the spec directory.

  3. Ensure that all tests pass with npm test

  4. rebase your changes against master. Do not merge.

  5. Submit a pull request to this repository. Wait for tests to run and someone to chime in.

Code Style

This repository is configured with EditorConfig and ESLint rules.

Versioning and Releasing

This repo is configured to use semantic-release. Commits prefixed with fix: and feat: will trigger patch and minor releases when merged to main.

To learn how to create major releases and release from maintenance branches, refer to the semantic-release GitHub Action documentation.