1
0
Fork 0
mirror of synced 2024-06-26 18:10:51 +12:00

temporary access - passing

This commit is contained in:
michael shanks 2019-06-26 22:29:28 +01:00
parent 80c7df9dae
commit e321a8b3fa
4 changed files with 4 additions and 8 deletions

View file

@ -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;
})

View file

@ -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,

View file

@ -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"});
}
}
}

View file

@ -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);