I am currently in the process of integrating an Angular application into a WordPress theme. Certain Angular components need to verify if a user is logged in and has a specific role in order to display certain content. Since WordPress is built on PHP and Angular on TypeScript, I am seeking guidance on how to achieve this.
One option I have tried is:
console.log(document.body.classList.contains( 'logged-in' ));
However, this method appears to be insecure as it only checks the login status without verifying the user role.