socialcast/devise_oauth2_providable — Issue #26: Error 500, NoMethodError (undefined method `refresh_tokens' for nil:NilClass):
Author: lgalabru
Created: 2011-11-30 09:36:31+00:00
State: open

Hello there,

I'm having an issue when trying to getting an access token from an iOS client (from an in-house SDK) with my rails-3.1.1 APIs.
The /authorize looks ok, and when I'm getting my authorization code and trying to post on /token, I'm experiencing some:
undefined method `refresh_tokens' for nil:NilClass (development mode).
It comes from tokens#create, and it looks like my env[Devise::Oauth2Providable::CLIENT_ENV_REF] is empty/nil.
I do have an ugly workaround, which consist in subclassing tokens_controller and overriding the method oauth2_current_client, authenticate_user! & cie and bypassing the calls on env[xxx].
Any idea?

Regards,