Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow providerParams to be a method invoked with the request #233

Merged
merged 3 commits into from Jul 17, 2016

Conversation

@connor4312
Copy link
Contributor

connor4312 commented Jun 15, 2016

This allows provideParams to be a method which, when invoked with the request object, returns query parameters to add to the request.

For certain OAuth servers which include additional metadata in the request (for us: Discord's OAuth system) it's sometimes desirable to be able to selectively request features depending on configuration in the auth request.

@ldesplat ldesplat added the feature label Jun 15, 2016
@ldesplat ldesplat added this to the 7.9.0 milestone Jun 15, 2016
@ldesplat

This comment has been minimized.

Copy link
Contributor

ldesplat commented Jun 19, 2016

You're missing the documentation for the scope parameter.

Also, under Advanced Usage, would you mind adding a section describing/showing an example on how to do that for scope and providerParams.

Otherwise, it looks good to me. I was debating if we should try/catch around the user code... We could show a nice error message and throw back the original exception but I am not 100% positive that's worth it. If anybody has an opinion that it should, do speak up! :)

@ldesplat ldesplat removed this from the 7.9.0 milestone Jun 19, 2016
@ldesplat

This comment has been minimized.

Copy link
Contributor

ldesplat commented Jul 16, 2016

Hi @connor4312 This is a great contribution. Could you please document the scope parameter changes?

@connor4312

This comment has been minimized.

Copy link
Contributor Author

connor4312 commented Jul 17, 2016

Sorry for the delay, I've updated the documentation and added and example as requested. Let me know if there's anything else to be tweaked 😄

@ldesplat

This comment has been minimized.

Copy link
Contributor

ldesplat commented Jul 17, 2016

👍 for the example

Very nice!

@ldesplat ldesplat added this to the 8.0.0 milestone Jul 17, 2016
@ldesplat ldesplat merged commit bf89461 into hapijs:master Jul 17, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.