Moralis.Object.registerSubclass("_User", CustomUser)?

Is this the correct format to register a subclass of the Moralis.User object?

I create my type with:

import Moralis from "moralis";
export class CustomUser extends Moralis.User {
  constructor(attributes: any) {
    super(attributes);
  }
}
Moralis.Object.registerSubclass("_User", CustomUser) 

After the above, I call:

const user: any = Moralis.authenticate({
          signingMessage: "Sign to create an account",
        });

I seem to get back a plain Moralis.User object not my CustomUser type.

not sure if this helps: https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#.registerSubclass

you can try to find out how to use it with Parse

Thanks I took a look and tried to test this out in the JS Console with no luck - see below. Iā€™m not sure what I am missing, but I thought this was possible per the docs at https://docs.moralis.io/moralis-server/database/objects

const customUser = Parse.User.extend('CustomUser', {
  test: function(msg) { console.log("Hello " + msg); }
});
Parse.Object.registerSubclass("_User", customUser)
const uQuery = new Parse.Query(Parse.User);
const user = await uQuery.get("spEtYRcYSh2cCFqnnsOTBGRB",{useMasterKey: true});
console.log(user.className)
try {
  console.log(user.test("Bob"));
}
catch (e) {
  console.log("Error=" + e.message)
}

const ucQuery = new Parse.Query(customUser);
//ucQuery.equalTo("objectId", "spEtYRcYSh2cCFqnnsOTBGRB")
//const users = await ucQuery.find({useMasterKey: true});

const cUser = await ucQuery.get("spEtYRcYSh2cCFqnnsOTBGRB", {useMasterKey: true});
//console.log(customUsers)
//const customUser = users[0]
console.log(cUser.className);
try {
  console.log(cUser.test("Custom"));
}
catch (e) {
  console.log("Error=" + e.message)
}

leads to:

"Log":{1 item
"result":string"_User"
}
"Log":{1 item
"result":string"Error=user.test is not a function"
}
"Log":{1 item
"result":string"_User"
}
"Log":{1 item
"result":string"Error=cUser.test is not a function"
}