I’m trying to get the Role name for the current user client side after login with:
Moralis.User.current().get('Role')
This is what it returns:
The attributes are empty and I can’t get the name. I’ve had some occasions where it did show up suddenly, so I’m wondering if there’s a timing issue or some promises not getting resolved.
How I’m logging in and logging the Role:
let user
try {
user = await Moralis.User.current()
if (!user) {
Moralis.Web3.getSigningData = () => 'Log into '+process.env.VUE_APP_NAME+' with this wallet'
user = await Moralis.Web3.authenticate()
}
const role = await Moralis.User.current().get('Role')
console.log(role);