Currently in the process of integrating Auth0 into a Vue.js/Node.js application, I have successfully enabled user registration and login functionality (to /callback). Although the manual addition of data to the user metadata section is functional at this stage, my end goal is to automate this process. Attached below is the code for a rule that has been activated. Despite this, I am facing difficulties accessing the data on the Vue.js side of things. What I aim to achieve is the retrieval of both user data and user metadata for storage within the frontend.
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);
}
The snippet above illustrates the rule code implemented. On the Vue.js front end, I have attempted the following:
getIdTokenClaims(o) {
return this.auth0Client.getIdTokenClaims(o);
}
However, the current output is undefined.