Whitelist filter. Fix #20

This commit is contained in:
Ludvig Janiuk 2018-08-02 11:38:15 +02:00
parent 5e502244cc
commit 8cfdd45de7
3 changed files with 13 additions and 0 deletions

6
.gitignore vendored
View File

@ -216,3 +216,9 @@ pip-log.txt
sftp-config.json
node_modules/
####################
# JetBrains
####################
.idea

View File

@ -264,5 +264,11 @@
});
};
// If this filter is not there, the deleteUserData function will fail when getting the metryId for deletion.
OAuth.whitelistFields = function(params, callback) {
params.whitelist.push(constants.name + 'Id');
callback(null, params);
};
module.exports = OAuth;
}(module));

View File

@ -6,6 +6,7 @@
"library": "./library.js",
"hooks": [
{ "hook": "static:user.delete", "method": "deleteUserData" },
{ "hook": "filter:user.whitelistFields", "method": "whitelistFields" },
{ "hook": "filter:auth.init", "method": "getStrategy" }
]
}