Skip to content

Commit

Permalink
added expires in and token type to parseHash response
Browse files Browse the repository at this point in the history
  • Loading branch information
glena committed Dec 7, 2016
1 parent e4af5b0 commit e81734e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/web-auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ WebAuth.prototype.parseHash = function (hash, options) {
idTokenPayload: token && token.payload ? token.payload : null,
appStatus: token ? token.appStatus || null : null,
refreshToken: parsedQs.refresh_token,
state: parsedQs.state
state: parsedQs.state,
expiresIn: parsedQs.expires_in || null,
tokenType: parsedQs.token_type || null
};
};

Expand Down
4 changes: 3 additions & 1 deletion test/helper/iframe-handler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ describe('helpers iframeHandler', function () {
},
appStatus: null,
refreshToken: 'kajshdgfkasdjhgfas',
state: 'theState'
state: 'theState',
expiresIn: null,
tokenType: 'Bearer'
});

done();
Expand Down
12 changes: 9 additions & 3 deletions test/web-auth/web-auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ describe('auth0.WebAuth', function () {
},
appStatus: null,
refreshToken: 'kajshdgfkasdjhgfas',
state: 'theState'
state: 'theState',
expiresIn: null,
tokenType: 'Bearer'
});
});

Expand All @@ -119,7 +121,9 @@ describe('auth0.WebAuth', function () {
},
appStatus: null,
refreshToken: 'kajshdgfkasdjhgfas',
state: 'theState'
state: 'theState',
expiresIn: null,
tokenType: 'Bearer'
});
});

Expand All @@ -139,7 +143,9 @@ describe('auth0.WebAuth', function () {
idTokenPayload: null,
appStatus: null,
refreshToken: 'kajshdgfkasdjhgfas',
state: 'theState'
state: 'theState',
expiresIn: null,
tokenType: 'Bearer'
});
});

Expand Down

0 comments on commit e81734e

Please sign in to comment.