From 056543870c9adfb9dc661066b82868747c813b85 Mon Sep 17 00:00:00 2001
From: xaralis <filip.varecha@fragaria.cz>
Date: Thu, 7 Jan 2021 15:23:15 +0100
Subject: [PATCH] fix: one of sentry issues

---
 src/App.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/App.jsx b/src/App.jsx
index a8c3e9f..4b983f2 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -48,7 +48,7 @@ const onKeycloakEvent = async (event) => {
   if (["onAuthRefreshSuccess", "onAuthSuccess"].includes(event)) {
     Sentry.setUser(keycloak.tokenParsed);
 
-    const kcRoles = keycloak.tokenParsed.roles;
+    const kcRoles = keycloak.tokenParsed.roles || [];
     let role = null;
 
     if (kcRoles.includes("chairman")) {
-- 
GitLab