Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b2fb6d6

Browse files
author
Sachin Maheshwari
committedOct 15, 2020
fixing roles feteching issue from RS256 token
1 parent 192233a commit b2fb6d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/common/helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function generateRandomString() {
5757
* @returns {boolean} whether it is authorized
5858
*/
5959
function isAuthorized(user) {
60-
const roles = user.roles || [];
60+
const roles = _.find(user, (value, key) => (key.indexOf('roles') !== -1));
6161
for (let i = 0; i < roles.length; i += 1) {
6262
for (let j = 0; j < config.ROLES.length; j += 1) {
6363
if (roles[i].trim().toLowerCase() === config.ROLES[j].trim().toLowerCase()) {

0 commit comments

Comments
 (0)
This repository has been archived.