Check if authenticated in JavaScript?

Using JavaScript, can we determine whether a user is authenticated?

For example, if I wanted to conditionally hide a “logout” button.

Sorry for the slow reply on this:
You can check if authenticated from js and _calcs with the following

vueapp.$store.state.auth.authenticated    // returns true if authenticated
1 Like