ueberauth / ueberauth_google

Google OAuth2 Strategy for รœberauth.
MIT License
166 stars 85 forks source link

Prefer Local Over Global Configuration #95

Closed aj-foster closed 2 years ago

aj-foster commented 2 years ago

Hello ๐Ÿ‘‹๐Ÿผ

This PR is primarily for discussion purposes, with code as a demonstration.

In the current implementation, if someone configures this provider using the global configuration shown in the README, they cannot then provide a different configuration at the call site. This is because the library overrides local / passed-in configuration options with the global config.

In my opinion, the library should prefer local over global [over the defaults]. This way, different call sites can provide their own options while still falling back to the global config. We intend to use this at CodeSandbox to provide logins via multiple Google OAuth clients โ€” one which is a clear default, and others which are specialized and locally configured.

Always open to feedback and discussion. Thanks!

yordis commented 2 years ago

It makes sense that you could overwrite things and fallback to globals. Thank you for your contribution.