Check if User is Authenticated and Control Visibility

Brian Hebert:
OK, I’m drawing a total blank and I can’t find an example. How do I do visibility on is authenticated?


Andrew Dam:
You can check whether or not a user is currently authenticated using
vueapp.$store.state.auth.authenticated


Andrew Dam:
For visibility on a field, you can add a calc to check this variable:

{
  "inputType": "text",
  "label": "My Input",
  "model": "field1",
  "styleClasses": "col-md-3",
  "visible_calc": "vueapp.$store.state.auth.authenticated",
  "type": "input"
}

Brian Hebert:
Thanks. My brain just couldn’t bring it up. Where’s Friday when you need it.


2 Likes