This gem attempts to integrate Devise into Grape in native Grape fashion.
Devise has great model modules, warden strategies etc so it's really tempts to use it when building APIs.
However devise controller layer doesn't fit well with Grape. Here where grape-devise
comes to the rescue.
Gem benifits:
current_user
Add this line to your application's Gemfile:
gem 'grape-devise'
And then execute:
$ bundle
Or install it yourself as:
$ gem install grape-devise
Grape::Devise::Helpers
helpers and include Grape::Devise::Endpoints
module into your API endpoints class e.g.class MyApi < Grape::API
helpers Grape::Devise::Helpers
include Grape::Devise::Endpoints
end
routes.rb
file. We will use Grape-styled endpoints for our API, not default Rails routes.Devise.add_mapping(:users, {})
to your devise.rb
initializer. Consider replacing :users
with appropriate symbol of your devise resource.:database_authenticatable
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)