getCurrentUser() is empty

Hello,
I am using JS API and I am trying to get a loggedin user according to

first-- Backendless.UserService.isValidLogin() - returns true… then

// get objectId of the logged-in user:
var userObjectId = Backendless.LocalCache.get(“current-user-id”)

// get user-token of the logged-in user:
var userToken = Backendless.LocalCache.get(“user-token”)

// get current user object:
var userObject = Backendless.UserService.getCurrentUser()

I get the current user id and the user-token, but the userObject is empty {}…

What am I missing?
thank you

Do you perform these methods just right after user login ?
Or you use stayLoggedIn ?

Backendless.UserService.getCurrentUser()
returns promise.

So you have to use asinc/await approach to get the result.

Thank you, working like a charm now…