From 1afbac5e6c57c5fbc91428b9e46fd57fbb6cecae Mon Sep 17 00:00:00 2001 From: German Lena Date: Wed, 7 Dec 2016 12:30:27 -0300 Subject: [PATCH] make sure no attr is undefined in parseHash response --- src/web-auth/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web-auth/index.js b/src/web-auth/index.js index 700a4d89..a776e3c1 100644 --- a/src/web-auth/index.js +++ b/src/web-auth/index.js @@ -79,12 +79,12 @@ WebAuth.prototype.parseHash = function (hash, options) { } return { - accessToken: parsedQs.access_token, + accessToken: parsedQs.access_token || null, idToken: parsedQs.id_token || null, idTokenPayload: token && token.payload ? token.payload : null, appStatus: token ? token.appStatus || null : null, - refreshToken: parsedQs.refresh_token, - state: parsedQs.state, + refreshToken: parsedQs.refresh_token || null, + state: parsedQs.state || null, expiresIn: parsedQs.expires_in || null, tokenType: parsedQs.token_type || null };