applicake/doorkeeper — Issue #44: NoMethodError - undefined method authenticate_admin!
Author: erlingur
Created: 2012-02-07 11:00:37+00:00
State: open

I have a very strange error pop up from time to time. I'll get this when I try to go to `/oauth/applications`:

NoMethodError (undefined method `authenticate_admin!' for #):

And when I restart webrick it will go away. In the same vain it will sometimes redirect me for no apparent reason to the login page (as per the config). The token has not been revoked or expired.

Started GET "/api/v1/purchases.json" for 127.0.0.1 at 2012-02-07 10:50:00 +0000
Processing by PurchasesController#index as JSON
Redirected to http://localhost:3000/login
Completed 302 Found in 11ms

My configuration is as follow:

Doorkeeper.configure do
resource_owner_authenticator do |routes|
current_user || redirect_to(routes.sign_in_path, :alert => t('needs_to_sign_in'))
end

admin_authenticator do |routes|
current_admin || redirect_to(routes.root_path)
end

access_token_expires_in 12.hours
use_refresh_token
end

I don't even know where to begin to try and debug this. Any ideas?