refactor the global variables as functions

This commit is contained in:
Girish Ramakrishnan
2018-04-29 20:11:45 -07:00
parent 91e846d976
commit f809e359c9
4 changed files with 201 additions and 173 deletions

View File

@@ -360,9 +360,11 @@ describe('Clients', function () {
};
// make csrf always succeed for testing
oauth2.csrf = function (req, res, next) {
req.csrfToken = function () { return hat(256); };
next();
oauth2.csrf = function () {
return function (req, res, next) {
req.csrfToken = function () { return hat(256); };
next();
};
};
function setup2(done) {

View File

@@ -189,9 +189,11 @@ describe('OAuth2', function () {
};
// make csrf always succeed for testing
oauth2.csrf = function (req, res, next) {
req.csrfToken = function () { return hat(256); };
next();
oauth2.csrf = function () {
return function (req, res, next) {
req.csrfToken = function () { return hat(256); };
next();
};
};
function setup(done) {
@@ -1281,9 +1283,11 @@ describe('Password', function () {
};
// make csrf always succeed for testing
oauth2.csrf = function (req, res, next) {
req.csrfToken = function () { return hat(256); };
next();
oauth2.csrf = function () {
return function (req, res, next) {
req.csrfToken = function () { return hat(256); };
next();
};
};
function setup(done) {