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

Fix optional configuration in Google provider #53

Merged
merged 1 commit into from
Mar 30, 2017
Merged

Fix optional configuration in Google provider #53

merged 1 commit into from
Mar 30, 2017

Conversation

pyrech
Copy link
Contributor

@pyrech pyrech commented Mar 24, 2017

Avoid notice Undefined index: access_type on this line when optional configuration is not given

@bocharsky-bw
Copy link
Member

bocharsky-bw commented Mar 24, 2017

Perfect sense 👍

@weaverryan Btw, probably we should use Symfony OptionsResolver component here to make error messages more obvious?

UPD: Or maybe we just can fix it with default values for those nodes?

@pyrech
Copy link
Contributor Author

pyrech commented Mar 24, 2017

Changed the PR to add default values 👍

->info('Optional value for sending access_type parameter. More detail: https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters')
->end()
->scalarNode('hosted_domain')
->defaultValue('')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but maybe we need null instead for access_type and hosted_domain options?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, I don't know, I used the defaults proposed in the README here.
Let me know what is you preference 😉

->info('Optional value for sending access_type parameter. More detail: https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters')
->end()
->scalarNode('hosted_domain')
->defaultValue('')
->info('Optional value for sending hd parameter. More detail: https://developers.google.com/identity/protocols/OpenIDConnect#hd-param')
->end()
->arrayNode('user_fields')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a default value (an empty array) for the user_fields option too, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested without defining default value for user_fields and it worked fine. So I suppose arrayNode / prototype make default value useless

@weaverryan weaverryan merged commit aabfd92 into knpuniversity:master Mar 30, 2017
@pyrech pyrech deleted the patch-3 branch March 30, 2017 10:51
@weaverryan
Copy link
Member

Thanks for reporting and fixing the bug! I added a bit more work on #54 - I would appreciate it if you tell me if it makes sense for you :). When I merge that, I'll tag a new release.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants