Created
November 27, 2012 00:18
-
-
Save mscoutermarsh/4151544 to your computer and use it in GitHub Desktop.
Grape API authentication methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module API | |
class Auth < Grape::API | |
# /api/auth | |
resource :auth do | |
# | |
# auth code goes here! | |
# | |
desc "Returns pong if logged in correctly." | |
params do | |
requires :token, :type => String, :desc => "Access token." | |
end | |
get :ping do | |
authenticate! | |
{ :message => "pong" } | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment