Sha256: 0118194efd23556afc618abd2b77eace1c2ac7787704ca8b4fe8b21cde5f1762

Contents?: true

Size: 828 Bytes

Versions: 3

Compression:

Stored size: 828 Bytes

Contents

module Doorkeeper
  class ApplicationController < ActionController::Base
    private

    def authenticate_resource_owner!
      current_resource_owner
    end

    def current_resource_owner
      instance_exec(main_app, &Doorkeeper.configuration.authenticate_resource_owner)
    end

    def resource_owner_from_credentials
      instance_exec(main_app, &Doorkeeper.configuration.resource_owner_from_credentials)
    end

    def authenticate_admin!
      if block = Doorkeeper.configuration.authenticate_admin
        instance_exec(main_app, &block)
      end
    end

    def method_missing(method, *args, &block)
      if method =~ /_(url|path)$/
        raise "Your path has not been found. Didn't you mean to call routes.#{method} in doorkeeper configuration blocks?"
      else
        super
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
doorkeeper-0.4.2 app/controllers/doorkeeper/application_controller.rb
doorkeeper-0.4.1 app/controllers/doorkeeper/application_controller.rb
doorkeeper-0.4.0 app/controllers/doorkeeper/application_controller.rb