omniauth/omniauth-oauth2

undefined method `expired?' for nil:NilClass

kinitawowi opened this issue ยท 2 comments

When a providers callback is called, it can result in no access token being generated, resulting in a call to expired? on nil.
This error is generated in /lib/omniauth/strategies/oauth2.rb:92

In the instances I'm seeing, this triggered by a get request to the google-oauth2/callback with no query string

omniauth-google-oauth2 (0.8.0)
omniauth-oauth2 (1.7.0)

When a providers callback is called, it can result in no access token being generated, resulting in a call to expired? on nil.
This error is generated in /lib/omniauth/strategies/oauth2.rb:92

In the instances I'm seeing, this triggered by a get request to the google-oauth2/callback with no query string

omniauth-google-oauth2 (0.8.0)
omniauth-oauth2 (1.7.0)

Any chance you found how to solve it? ๐Ÿ˜“

The obvious solution to me, fail with a CallbackError if the access_token is blank.