My code works with this function:
// Function to retrieve the Guardians Enrollments (MFA)
function getMFAEnrollments(auth0Client, auth0UserId) {
return new Promise((resolve, reject) => {
auth0Client.getGuardianEnrollments({ id: auth0UserId }).then((enrollments) => {
resolve(enrollments);
}).catch((err) => {
const errMFA = {
code: 'scim_error_MFA_getGuardianEnrollments',
message: 'Error: Unable to retrieve the enrollments!',
details: err
};
reject(errMFA);
});
});
}
But when I tried with another function from the same class (that seems to work the same way), my request returns an error: “auth0Client.getUserBlocks is not a function”
// Function to retrieve the User's Blocks (brute-force)
function getBlocksById(auth0Client, auth0UserId) {
return new Promise((resolve, reject) => {
auth0Client.getUserBlocks({ id: auth0UserId }).then((blocks) => {
resolve(blocks);
}).catch((err) => {
const errBlocks = {
code: 'scim_error_Blocks_getUserBlocks',
message: 'Error: Unable to retrieve blocks!',
details: err
};
reject(errBlocks);
});
});
}
Anybody knows why this is happening? Thanks