Skip to content

Instantly share code, notes, and snippets.

@chromeragnarok
Created September 11, 2011 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chromeragnarok/1209800 to your computer and use it in GitHub Desktop.
Save chromeragnarok/1209800 to your computer and use it in GitHub Desktop.
class Api::ApiController < ApplicationController
def authenticate_with_token
if user = authenticate_with_http_token { |t, o|
User.authenticate(t, o)
}
@current_user = user
else
request_http_token_authentication
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment