File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
forms-flow-service/src/keycloak Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -117,9 +117,9 @@ import Keycloak, {
117117 . then ( ( authenticated ) => {
118118 if ( authenticated ) {
119119 console . log ( "Authenticated" ) ;
120- const tokenParsed = this . kc . tokenParsed || { } ;
121- const UserRoles = tokenParsed . roles || tokenParsed . role || tokenParsed . client_roles || [ ] ;
122- if ( UserRoles . length > 0 ) {
120+ const tokenParsed = this . kc . tokenParsed ;
121+ if ( tokenParsed ) {
122+ const UserRoles = tokenParsed . roles || tokenParsed . role || tokenParsed . client_roles ;
123123 if ( ! UserRoles ) {
124124 callback ( false ) ;
125125 }
@@ -138,10 +138,10 @@ import Keycloak, {
138138 } ) ;
139139 this . refreshToken ( ) ;
140140 }
141- }
142- else {
141+ } else {
143142 this . logout ( ) ;
144143 }
144+
145145 } else {
146146 console . warn ( "not authenticated!" ) ;
147147 this . login ( ) ;
You can’t perform that action at this time.
0 commit comments