lib/devise/doorkeeper.rb in devise-doorkeeper-1.1.1 vs lib/devise/doorkeeper.rb in devise-doorkeeper-1.1.2.ci.30.1
- old
+ new
@@ -1,16 +1,16 @@
require 'devise/doorkeeper/version'
require 'devise/strategies/doorkeeper'
+require 'devise/doorkeeper/doorkeeper_failure_app'
module Devise
module Doorkeeper
+ # configure devise to support doorkeeper error responses
def self.configure_devise(config)
- config.warden do |manager|
- require 'devise/doorkeeper/doorkeeper_failure_app'
- manager.failure_app = Devise::Doorkeeper::DoorkeeperFailureApp
- end
+ Devise::FailureApp.prepend(Devise::Doorkeeper::DoorkeeperFailureApp)
end
+ # configure doorkeeper to use devise authentication
def self.configure_doorkeeper(base)
base.instance_eval do
resource_owner_authenticator do
current_user || warden.authenticate!(scope: :user)
end