Skip to content

Commit

Permalink
Do not throw auth failed if no user in acl
Browse files Browse the repository at this point in the history
  • Loading branch information
RobAndrewHurst committed Mar 6, 2024
1 parent d64315a commit 61fbcf9
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
4 changes: 4 additions & 0 deletions jsdoc_mapp.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"plugins": [
"plugins/markdown"
],

"opts": {
"encoding": "utf8",
"readme": "./lib/README.md",
Expand All @@ -16,6 +17,9 @@
"verbose": true,
"template": "./node_modules/clean-jsdoc-theme",
"theme_opts": {
"include_js": [
"./public/js/docs/navbar.js"
],
"title": "Mapp",
"homepageTitle": "Mapp",
"favicon": "../public/icons/favicon.ico"
Expand Down
2 changes: 1 addition & 1 deletion jsdoc_xyz.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"theme_opts": {
"title": "XYZ",
"homepageTitle": "XYZ",
"static_dir": ["./public/icons"],
"static_dir": ["./public/icons", "./public/js/docs"],
"favicon": "./public/icons/favicon.ico"
}
},
Expand Down
3 changes: 2 additions & 1 deletion mod/user/fromACL.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ async function getUser(request) {
// Get user record from first row.
const user = rows[0]

if (!user) return new Error('auth_failed')
//If there is no user in the ACL do not throw error.
if (!user) return;

if (!user.password) return;

Expand Down
32 changes: 32 additions & 0 deletions public/js/docs/navbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
document.addEventListener('DOMContentLoaded', function () {
// Get the container element for the modules section
const sidebarModulesContainer = document.querySelector('#sidebar > div > div.sidebar-section-children-container');

// Get all elements within the modules section container
const moduleElements = sidebarModulesContainer.querySelectorAll('*');

// Create an object to store grouped elements
const groupedElements = {};

// Iterate over each module element
moduleElements.forEach(element => {
// Check if the element's classes contain the desired substring
if (element.classList.contains('/layer/')) {
// Get the common substring
const substring = '/layer/';

// Check if a group for this substring exists, if not, create one
if (!groupedElements[substring]) {
groupedElements[substring] = [];
}

// Add the element to the appropriate group
groupedElements[substring].push(element);
}
});

// Now you have groupedElements object containing groups of elements based on the "/layer/" substring
console.log(groupedElements);


});

0 comments on commit 61fbcf9

Please sign in to comment.