Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: role.map is not a function #23

Open
fancyoung opened this issue Mar 28, 2022 · 1 comment
Open

TypeError: role.map is not a function #23

fancyoung opened this issue Mar 28, 2022 · 1 comment

Comments

@fancyoung
Copy link

fancyoung commented Mar 28, 2022

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
Copy link
Author

fancyoung commented Mar 29, 2022

I made a pull request #24 . I'm not sure it's correct, but it's working for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant