As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
Ok, thanks for clarifying. Doesn't "insufficient credentials" apply to this case too? Requesting current user details without valid session token seems like a credentials issue.
Hi,
The call to Kinvey backend will typically fail and execute catch block because of following reasons: network interruption, insufficient credentials etc. Because your code executed correctly, it went into then execution block every time.
If you want to see catch block execution, you can disable wifi on your testing device/simulator before making a call to Kinvey backend.
Regards,
Wani
Hi,
thanks for a prompt reply.
You're right, user wasn't logged in (v3 is using different keys in localStorage and other places than v1).
The part that got me confused is that the promise from example never fails (never calls `catch` callback), even if user isn't logged in. In what scenarios does it actually fail?
Greetings
Hi,
The activeUser will be null before login is performed. Are you calling login after initialize and before getActiveUser?
Regards,
Wani
Kinvey Support
It seems this is still broken. I've tried the following code:
Kinvey.initialize({ appKey: '<appKey>', appSecret: '<appSecret>' }).then(function(activeUser) { // activeUser is null var activeUser = Kinvey.User.getActiveUser(); var promise = Promise.resolve(activeUser); if (activeUser !== null) { promise = activeUser.me(); } promise .then(function(activeUser) { // activeUser is still null }) .catch(function(error) { // ... }); }).catch(function(error) { // ... })
and activeUser is always null
daniel_sedlacek
var promise = Kinvey.init({
appKey : 'App Key',
appSecret : 'App Secret'
});
promise.then(function(activeUser) {
...
}, function(error) {
...
});
but even if the credentials are wrong the success branch of the promise is invoked instead of the error branch.
See it for yourself http://jsfiddle.net/rny8crm9/2/