Language: TypeScript
Label: safe
CWE: CWE-346 \u2014 Origin Validation Error
The product does not properly verify that the source of data or communication is valid.

Code:
	getTokenFromRequest: (req) => {
		if (req.headers['x-csrf-token']) {
			return req.headers['x-csrf-token'];
		} else if (req.body && req.body.csrf_token) {
			return req.body.csrf_token;
		} else if (req.query) {
			return req.query._csrf;
		}
	},