webaccess: Pass settings.users to the authenticate hook

Authentication plugins almost always want to read and modify
`settings.users`. The settings can already be accessed in a few other
ways, but this is much more convenient.
This commit is contained in:
Richard Hansen 2020-08-27 01:00:36 -04:00 committed by John McLear
parent 250e932f59
commit 80639fdc6a
2 changed files with 8 additions and 13 deletions

View file

@ -65,7 +65,8 @@ exports.checkAccess = (req, res, next) => {
step1PreAuthenticate = () => authorize(step2Authenticate);
step2Authenticate = () => {
const ctx = {req, res, next};
if (settings.users == null) settings.users = {};
const ctx = {req, res, users: settings.users, next};
// If the HTTP basic auth header is present, extract the username and password so it can be
// given to authn plugins.
const httpBasicAuth =