omniauth-oauth2 icon indicating copy to clipboard operation
omniauth-oauth2 copied to clipboard

set access_token when test_mode=true

Open langalex opened this issue 11 years ago • 1 comments

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.

langalex avatar Jun 03 '14 16:06 langalex

Care to submit a pull request for this? I would be happy to accept it.

isaacsanders avatar Sep 24 '14 19:09 isaacsanders