The keycloak variable is undefined if we try to get it from a function that was called by a button. @onClick=myFunc. myFunc -> can't access $keycloak.