From 46d306a217e6101a2c37f4eeaf6760e96537bd60 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 17 Aug 2016 17:16:19 +0100 Subject: [PATCH] Change register response access_token to scalar_token --- src/ScalarAuthClient.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ScalarAuthClient.js b/src/ScalarAuthClient.js index 67607b4996..d145cebfe0 100644 --- a/src/ScalarAuthClient.js +++ b/src/ScalarAuthClient.js @@ -34,8 +34,10 @@ class ScalarAuthClient { defer.reject(err); } else if (response.statusCode / 100 !== 2) { defer.reject({statusCode: response.statusCode}); + } else if (!body || !body.scalar_token) { + defer.reject(new Error("Missing scalar_token in response")); } else { - defer.resolve(body.access_token); + defer.resolve(body.scalar_token); } });