From 9f1359e04f73fef10564ff9b1d7e286565f50257 Mon Sep 17 00:00:00 2001 From: FlayInAHook Date: Wed, 16 Dec 2020 14:39:55 +0100 Subject: [PATCH] fixed loading issues of users without role --- src/app/services/auth.service.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/services/auth.service.ts b/src/app/services/auth.service.ts index 54adc6f..f558ceb 100644 --- a/src/app/services/auth.service.ts +++ b/src/app/services/auth.service.ts @@ -35,8 +35,12 @@ export class AuthService { } if (value.user != undefined){ let roles = []; - for (let role of value.user.roles){ - roles.push(role.name); + if (value.user.roles.length !== 0 ){ + + for (let role of value.user.roles){ + roles.push(role.name); + } + } value.user.rolesString = roles.join(', '); console.log("Getting user" + JSON.stringify(value));