Skip to content

Commit

Permalink
[v8] SignupAndLogin blows up if no response type is set #271
Browse files Browse the repository at this point in the history
  • Loading branch information
glena committed Dec 16, 2016
1 parent 96f85be commit 513c1bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/web-auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ WebAuth.prototype.login = function (options) {
'audience'
]).with(options);

assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {
responseType: { optional: true, type: 'string', message: 'responseType option is required' }
});

params = this.transactionManager.process(params);

windowHelper.redirect(this.client.buildAuthorizeUrl(params));
Expand Down
4 changes: 4 additions & 0 deletions src/web-auth/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Redirect.prototype.login = function (options, cb) {

this.warn.warning('`webauth.redirect.login` will be soon deprecated, use `webauth.login` instead.');

assert.check(params, { type: 'object', message: 'options parameter is not valid' }, {
responseType: { optional: true, type: 'string', message: 'responseType option is required' }
});

params = this.transactionManager.process(params);

usernamePassword = new UsernamePassword(this.baseOptions);
Expand Down

0 comments on commit 513c1bb

Please sign in to comment.