Skip to content

Commit

Permalink
Merge pull request #2267 from hollaex/testnet
Browse files Browse the repository at this point in the history
Testnet
  • Loading branch information
abeikverdi authored Jul 12, 2023
2 parents ae33790 + 02ce79a commit fdfb048
Show file tree
Hide file tree
Showing 2 changed files with 299 additions and 273 deletions.
8 changes: 8 additions & 0 deletions server/api/controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,10 @@ const getAdminUserLogins = (req, res) => {
);
const { user_id, status, country, ip, limit, page, start_date, order_by, order, end_date, format } = req.swagger.params;

if (format.value && req.auth.scopes.indexOf(ROLES.ADMIN) === -1) {
return res.status(403).json({ message: API_KEY_NOT_PERMITTED });
}

if (start_date.value && !isDate(start_date.value)) {
loggerAdmin.error(
req.uuid,
Expand Down Expand Up @@ -2392,6 +2396,10 @@ const getUserSessionsByAdmin = (req, res) => {

const { user_id, last_seen, status, limit, page, order_by, order, start_date, end_date, format } = req.swagger.params;

if (format.value && req.auth.scopes.indexOf(ROLES.ADMIN) === -1) {
return res.status(403).json({ message: API_KEY_NOT_PERMITTED });
}

if (order_by.value && typeof order_by.value !== 'string') {
loggerAdmin.error(
req.uuid,
Expand Down
Loading

0 comments on commit fdfb048

Please sign in to comment.