ewdave / passport-nylas

Nylas authentication strategy for Passport using the OAuth 2.0 API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

State param inside the verify callback

alerosa opened this issue · comments

Hi,
I'm using your passport-nylas and I have some trouble getting access to the state param in my verifier callback. (https://docs.nylas.com/reference#oauthauthorize)
Basically, I'm passing the state parameter to Nylas, like this .../auth/nylas?state=something and I have it back from Nylas inside req.query along with code.

Checking the source code of your library I've noticed that the 'verify' callback is called only with the email coming from the oAuth token request: https://github.com/ewdave/passport-nylas/blob/master/nylas-strategy.js#L176 so the entire request object is not available inside the verifier callback.

What do you think about passing the the entire request object + the email instead of only the email to the verifier callback? It would be a breaking change but I don't have any better idea :)

Thanks a lot and keep up the good work!

@ewdave have you had a look at this?

Ahhh not yet @alerosa @cdimitroulas Apologies. I totally missed this issue.