houdini/gems/grape_devise
2019-08-02 19:07:29 +02:00
..
lib style(format): run rubocop format autocorrect 2019-08-02 19:07:29 +02:00
spec style(format): run rubocop format autocorrect 2019-08-02 19:07:29 +02:00
.gitignore Add Grape Devise into our gems because it's unsupported 2019-02-01 13:15:35 -06:00
.travis.yml Add Grape Devise into our gems because it's unsupported 2019-02-01 13:15:35 -06:00
Gemfile style(format): run rubocop format autocorrect 2019-08-02 19:07:29 +02:00
Gemfile.lock Add Grape Devise into our gems because it's unsupported 2019-02-01 13:15:35 -06:00
grape_devise.gemspec style(format): run rubocop format autocorrect 2019-08-02 19:07:29 +02:00
MIT-LICENSE Add Grape Devise into our gems because it's unsupported 2019-02-01 13:15:35 -06:00
Rakefile style(format): run rubocop format autocorrect 2019-08-02 19:07:29 +02:00
README.md Add Grape Devise into our gems because it's unsupported 2019-02-01 13:15:35 -06:00

Grape::Devise

Grape::Devise adds support for devise helpers from inside Grape::APIs.

NOTE: this project was originally at https://github.com/justinm/grape_devise but is not longer supported so we moved it into our repo.

Installing

Installing is simple. Just add the grape_devise gem to your Gemfile, run bundle install and it's ready to go.

gem 'grape_devise'

Usage

The devise API can now be accessed from inside of Grape request blocks.

class MyAPI < Grape::API
    get "/requires-authentication" do
        authenticate_user!
    end
    
    get "/who-am-i" do
        current_user
    end
end

FAQ

####Can I use this with rails Yes you can! Grape::Devise works with your existing rails sessions to provide seamless authentication between your rails app and grape APIs.