node-uber icon indicating copy to clipboard operation
node-uber copied to clipboard

Enhancement: State Parameter Support With Authentication Workflow

Open gjsjy opened this issue 4 years ago • 0 comments

Hi,

Is there possibility to enhance getAuthorizeUrl to include "State" parameter?

var authURL = oauth2.getAuthorizeUrl({ redirect_uri: 'http://localhost:8080/code', scope: ['repo', 'user'], state: 'some random string to protect against cross-site request forgery attacks' });

Currently not passing down that params to OAuth

Uber.prototype.getAuthorizeUrl = function getAuthorizeUrl(scope) { if (!Array.isArray(scope)) { return new Error('Scope is not an array'); } if (scope.length === 0) { return new Error('Scope is empty'); } return this.oauth2.getAuthorizeUrl({ response_type: 'code', redirect_uri: this.defaults.redirect_uri, scope: scope.join(' ') }); };

I appreciate your help here.

Thanks, Jo

gjsjy avatar Oct 01 '21 15:10 gjsjy