zquestz / omniauth-google-oauth2

Oauth2 strategy for Google
1.45k stars 414 forks source link

Constrain omniauth version #396

Closed dudemanvox closed 3 years ago

dudemanvox commented 3 years ago

Relates to issue #395

atmos commented 3 years ago

Couldn't you just pin your devise version in the Gemfile so people who aren't using devise get the latest version of omniauth?

dudemanvox commented 3 years ago

Couldn't you just pin your devise version in the Gemfile so people who aren't using devise get the latest version of omniauth?

Hey @atmos,

I guess I was looking at it as if this gem were intended for use with devise, but no, pinning the devise version wouldn't (currently) address the issue. The code below has been in there for 9 years, so not a recent thing by any stretch, and I'd think would remain until they implement omniauth v 2.

Was thinking that any fresh bundle with both gems could be an issue/headache for folks - the devise error is also a bit misleading now since it assumes any version not beginning with '1.' is an older version.

https://github.com/heartcombo/devise/blob/e0395367e4a06eaf5915c650f048249bcf0c9bda/lib/devise/omniauth.rb#L11

unless OmniAuth::VERSION =~ /^1\./
  raise "You are using an old OmniAuth version, please ensure you have 1.0.0.pr2 version or later installed."
end

That being said, explicitly including omniauth in a gemfile and constraining the version there in the same way gem 'omniauth', '~> 1.1' would take care of it and not impact folks not using devise.