stayLoggedIn - stores data in LocalCache, not Cache?

Hey… I’m testing some things on the javascript sdk, and noticed that passing “stayLoggedIn” to the login method stores data in the

Backendless.LocalCache.get(“user-token”)

not

Backendless.Cache.get(“user-token”)

as suggested in the docs… (https://backendless.com/documentation/users/js/), and as a side note, it’d be nice if the docs weren’t in an iframe, and had links by title/id, so it’d be easy to link to docs in things like this…

Thanks!

Hi Brad!

It is just mistake in documentation. We will change it.
Thank you!

Regards,
Kate.

hey… thanks for the feedback… One more thing - if I have a user login using “stayLoggedIn”, the next time I refresh the page, the user token is returned using

Backendless.LocalCache.get(“user-token”)

but

Backendless.UserService.getCurrentUser();

returns null.

Shouldnt this return the a User object instance like it did if I just logged in?

and if this is by design, how can i use that token to query for info about the current user? ie to get the User object?

Hi Brad!

This logic needs several changes (to receive not null currentUser in this case).
I will notify you when they will be implemented.

Regards,
Kate.

Thanks for the reply! Happy Holidays!

Hi Brad!

We have made several changes in JS SDK.
It works as you expect:

Backendless.UserService.getCurrentUser();
returns user object.

Happy Holidays for you too!

Thanks for the quick response… I checked it out and it works great… thanks again!