koa-2-acl
koa-2-acl copied to clipboard
TypeError: role.map is not a function
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.
I made a pull request #24 . I'm not sure it's correct, but it's working for me.