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

Added Omniauth Google Oauth2 #201

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Added Omniauth Google Oauth2 #201

wants to merge 1 commit into from

Conversation

mghaught
Copy link
Member

Currently a WIP but the basic flow works.

@mghaught mghaught requested a review from barrettclark August 13, 2020 22:59
@barrettclark
Copy link
Member

I think this looks good. There may be some rough edges to smooth out for cases where you do not use all 3 OAuth providers. Most of those look like you could add some simple checks like you did in the application helper, probably with the exception of the user model.

If those checks end up being useful in other places maybe you could do something in an initializer and add them to the application's config. Maybe something like this:

# config/initializers/oauth_providers.rb

Rails.application.config.oauth_providers = ActiveSupport::OrderedOptions.new
Rails.application.config.oauth_providers.github = ENV['GITHUB_KEY'].present?
Rails.application.config.oauth_providers.google = ENV['GOOGLE_OAUTH_CLIENT_ID'].present?
Rails.application.config.oauth_providers.twitter = ENV['TWITTER_KEY'].present?

We actually have a gem at TCS that does something similar to this. We load a YAML file and the gem then knows how to get data from the environment, consul, or vault.

Base automatically changed from master to main March 24, 2021 19:50
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.

2 participants