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

undefined method `expired?' for nil:NilClass #138

Open
kinitawowi opened this issue Feb 19, 2021 · 2 comments
Open

undefined method `expired?' for nil:NilClass #138

kinitawowi opened this issue Feb 19, 2021 · 2 comments

Comments

@kinitawowi
Copy link

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)

@alextrueman
Copy link

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? 😓

@kinitawowi
Copy link
Author

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

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

No branches or pull requests

2 participants