Hello Everyone,
In Visual Studio Code I would like to get and display the role of the currently logged in user, I log in using a local account. So far I have managed to write such code but it does not get any roles, it constantly displays that the user is not logged in:
<div>
<h2>Roles of the currently logged in user:</h2>
{% if currentUser %}
<ul>
{% assign userRoles = currentUser.roles | split: ',' %}
{% for role in userRoles %}
<li>{{ role }}</li>
{% endfor %}
</ul>
{% else %}
<p>No user data found. Check if you are logged in.</p>
{% endif %}
</div>