Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 

grape-doorkeeper

Code Climate endorse

Integration Grape with Doorkeeper

class API < Grape::API
  helpers do
    def current_token; env['api.token'] end
    def current_user; @current_user ||= Acl::User.find(current_token.resource_owner_id) if current_token end
  end
  
  doorkeeper_for :all, scopes: [:read]
  
  get :hello do
    {:hello => current_user.email }
  end
  
  get :by, protected: false do
    {:by => 1 }
  end

  # Use a different scope for this endpoint.
  get :bar, scopes: [:write] do
    {:bar=> 1 }
  end
  
  resource :statuses do
    get :count do
      {:count => 0 }
    end  
    
  end
end

About

Integration Grape with Doorkeeper

Resources

License

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages