Browse Source

temporary access - passing

pull/12/head
michael shanks 7 years ago
parent
commit
e321a8b3fa
  1. 2
      packages/server/middleware/routers.js
  2. 2
      packages/server/tests/authenticate.js
  3. 2
      packages/server/tests/testApp.js
  4. 6
      packages/server/utilities/masterAppInternal.js

2
packages/server/middleware/routers.js

@ -42,7 +42,7 @@ module.exports = (config, app) => {
await instanceApi.authApi.setPasswordFromTemporaryCode(
ctx.request.body.tempCode,
ctx.request.body.newpassword);
ctx.request.body.newPassword);
ctx.response.status = StatusCodes.OK;
})

2
packages/server/tests/authenticate.js

@ -133,7 +133,7 @@ module.exports = (app) => {
testPassword = "test_user_new_password";
const tempCode = await readFile(`tempaccess${testUserName}`, "utf8");
const tempCode = await readFile(`./tests/.data/tempaccess${testUserName}`, "utf8");
await app.post("/_master/api/setPasswordFromTemporaryCode", {
username: testUserName,

2
packages/server/tests/testApp.js

@ -13,7 +13,7 @@ const masterOwnerPassword = "test_master_pass";
const masterPlugins = {
main: {
outputToFile : ({filename, content}) => {
fs.writeFile(`./tests/${filename}`, content, {encoding:"utf8"});
fs.writeFile(`./tests/.data/${filename}`, content, {encoding:"utf8"});
}
}
}

6
packages/server/utilities/masterAppInternal.js

@ -154,11 +154,7 @@ module.exports = async (config) => {
const getFullAccessInstanceApiForUsername = async (appname, username) => {
if(isMaster(appname)) {
const user = bb.authApi.getUsers()
.find(u => u.name === username);
if(!user) return;
if(!user.enabled) return;
return user;
return bb;
}
else {
const app = await getApplication(appname);

Loading…
Cancel
Save