omniauth-oauth2
omniauth-oauth2 copied to clipboard
set access_token when test_mode=true
When not in test mode, after the callback phase I can call env['omniauth.strategy'].acces_token.get('/xyz') to make authenticated requests. In test mode access_token is not set as the normal callback phase code is never called.
At the moment I work around this in my tests using
OmniAuth.config.before_callback_phase = ->(env) {
env['omniauth.strategy'].access_token = env['omniauth.strategy'].send(:build_access_token)
}
but it would be better if this was default behavior.
Care to submit a pull request for this? I would be happy to accept it.