Hello, I am trying to link accounts via the management api using the auth0.js library. I am using the following code.
linkAccounts(authResult) {
return new Promise((resolve) => {
const auth0Manage = new auth0.Management({
domain: 'demandhive.auth0.com',
token: this.getAccessToken(),
});
const secondaryUserToken = authResult.idToken;
auth0Manage.linkUser(this.getIdToken(),secondaryUserToken, (err,response,body) => {
console.log(err,response,body)
resolve()
});
})
}
However, when I make the call, I am receiving a status 400: bad request.
The error I get is:
"Path validation error: 'Object didn't pass validation for format user-id: <sent_token>...
on property id (The user_id of the primary identity where you are linking the secondary account to).