Skip to content

Commit 3ba41c7

Browse files
committed
Fix M2M token handling
1 parent 8845b5a commit 3ba41c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/common/helper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ function autoWrapExpress (obj) {
8484
* @param {Object} authUser the user
8585
*/
8686
function hasAdminRole (authUser) {
87+
if (!authUser || !Array.isArray(authUser.roles)) {
88+
return false
89+
}
8790
for (let i = 0; i < authUser.roles.length; i++) {
8891
if (authUser.roles[i].toLowerCase() === constants.UserRoles.Admin.toLowerCase()) {
8992
return true

0 commit comments

Comments
 (0)