How can I check if the user is logged in to the application (HTML5)?
I have the get user info tool then an IF statement but if the user is not logged in then userinfo1.username is undefined. and I can't find the correct statement to check for undefined.
I tried
$userInfo1.username.lenght > 0
$userInfo1.username === "undefined"
typeof $userInfo1.username !== "undefined"
not sure where to go from here.
0
-
You want
=$userInfo1.username === undefined--Ryan
0 -
Hi Thomas,
I would suggest using the roles parameter instead of username, as it is a String[] type.
In the If statement, you can use: =$userInfo1.roles.length > 0
Thanks, Stefan
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
2 kommentarer