Skip to content

Commit

Permalink
Merge pull request #164 from jbendes/core/redirect-optional
Browse files Browse the repository at this point in the history
Optional redirectUri in single user mode
  • Loading branch information
kevinohara80 committed Jan 4, 2019
2 parents beacffe + 0f2e4a0 commit dea1a71
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Expand Up @@ -62,7 +62,6 @@ var Connection = function(opts) {

// validate options
if(!_.isString(this.clientId)) throw new Error('invalid or missing clientId');
if(!_.isString(this.redirectUri)) throw new Error('invalid or missing redirectUri');
if(!_.isString(this.authEndpoint)) throw new Error('invalid or missing authEndpoint');
if(!_.isString(this.testAuthEndpoint)) throw new Error('invalid or missing testAuthEndpoint');
if(!_.isString(this.loginUri)) throw new Error('invalid or missing loginUri');
Expand All @@ -74,6 +73,9 @@ var Connection = function(opts) {
if(!_.isString(this.mode) || _.indexOf(MODES, this.mode) === -1) {
throw new Error('invalid mode, only ' + MODES.join(' and ') + ' are allowed');
}
if(!_.isString(this.redirectUri) && this.mode != 'single') {
throw new Error('invalid or missing redirectUri');
}
if(this.onRefresh && !_.isFunction(this.onRefresh)) throw new Error('onRefresh must be a function');
if(this.timeout && !_.isNumber(this.timeout)) throw new Error('timeout must be a number');

Expand Down

0 comments on commit dea1a71

Please sign in to comment.