Skip to content

Commit

Permalink
Fixed inconsistencies in client.token (#45)
Browse files Browse the repository at this point in the history
Resolves: OKTA-102903
  • Loading branch information
lboyette-okta authored Sep 30, 2016
1 parent b21b9b7 commit e3f8679
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions lib/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ function verifyIdToken(sdk, idToken, options) {
});
}

function refreshIdToken(sdk, opts) {
opts = opts || {};
opts.display = null;
opts.prompt = 'none';
return getToken(sdk, opts);
function refreshIdToken(sdk, options) {
options = options || {};
options.display = null;
options.prompt = 'none';
return getToken(sdk, options);
}

function loadFrame(src) {
Expand Down Expand Up @@ -394,7 +394,7 @@ function buildAuthorizeUrl(sdk, oauthParams) {
*
* Two main flows:
*
* 1) Exchange a sessionToken for an idToken
* 1) Exchange a sessionToken for a token
*
* Required:
* clientId: passed via the OktaAuth constructor or into getToken
Expand All @@ -409,7 +409,7 @@ function buildAuthorizeUrl(sdk, oauthParams) {
* responseMode: 'okta_post_message'
* display: undefined
*
* 2) Get an idToken from an idp
* 2) Get a token from an idp
*
* Required:
* clientId: passed via the OktaAuth constructor or into getToken
Expand Down Expand Up @@ -440,13 +440,8 @@ function buildAuthorizeUrl(sdk, oauthParams) {
* Defaults to 'External Identity Provider User Authentication'
*/
function getToken(sdk, oauthOptions, options) {
if (!oauthOptions) {
oauthOptions = {};
}

if (!options) {
options = {};
}
oauthOptions = oauthOptions || {};
options = options || {};

// Default OAuth query params
var oauthParams = getDefaultOAuthParams(sdk, oauthOptions);
Expand Down

0 comments on commit e3f8679

Please sign in to comment.