diff --git a/lib/context.js b/lib/context.js
index <HASH>..<HASH> 100644
--- a/lib/context.js
+++ b/lib/context.js
@@ -299,8 +299,12 @@
 
             callback = callback || function() {};
             var wrappedCallback = function(err, response) {
-                if (err) {
-                    callback(err, false);
+                // Let's make sure that not only did the request succeed, but
+                // we actually got a non-empty session key back.
+                var hasSessionKey = !!(!err && response.data && response.data.sessionKey);
+
+                if (err || !hasSessionKey) {
+                    callback(err || "No session key available", false);
                 }
                 else {
                     that.sessionKey = response.data.sessionKey;
Ensure we actually get a session key on authentication (DVPL-<I>)

If a login request succeeded (it got a <I>), but got an empty session
key back, we would incorrectly report this as a success. This fix
ensures we check for a non-empty session key.