Unable to access ID token

Please include the following information in your post:

  • Which SDK this is regarding:
    @auth0/auth0-spa-js
  • SDK Version: e.g. 2.29.0
    5.6.55
  • Platform Version: e.g. Node 12.19.0
    Vue.js
  • Code Snippets/Error Messages/Supporting Details/Screenshots:
    I am currently working on adding Auth0 to a Vue.js/Node.js application and so far I have figured out how to allow users to register and log in (to /callback) and that seems to be working fine. However, I have manually added (will be automatic later on) some data to the user metadata section. I have the below code as a rule that is turned on. I can’t seem to get access to the data on the Vue.js end of things. What I’d like is to be able to get the user data and user metadata so I can store it in my front end.

Rule code

function (user, context, callback) {
  const namespace = 'account_signup_type/';
  const namespace2 = 'account_type';
  context.idToken[namespace + 'is_new'] = (context.stats.loginsCount === 1);
  context.idToken[namespace2] = user.account_type;
  context.idToken.user = user;
  callback(null, user, context);
}

Code I am trying in my Vue.js front end

getIdTokenClaims(o) {
        return this.auth0Client.getIdTokenClaims(o);
}

Currently, this returns undefined