koa-2-acl icon indicating copy to clipboard operation
koa-2-acl copied to clipboard

TypeError: role.map is not a function

Open fancyoung opened this issue 2 years ago • 1 comments

It seems using if (typeof role.length) { to identify array, but it is true when role is a string. So will show error: TypeError: role.map is not a function.

Why not use if (typeof role == 'object') {?

https://github.com/JefferyLiang/koa-2-acl/blob/master/lib/index.js#L57

But when I update it, there will be other error. It seems the code is not updated correctly, and some config like multipleRolePropertyName is not in document.

fancyoung avatar Mar 28 '22 09:03 fancyoung