Skip to content

Instantly share code, notes, and snippets.

@danpariente
Created December 27, 2013 21:43
Show Gist options
  • Save danpariente/8153048 to your computer and use it in GitHub Desktop.
Save danpariente/8153048 to your computer and use it in GitHub Desktop.
token authentication
def authenticate_user
@current_user = User.find_by_authentication_token(params[:token])
unless @current_user
respond_with({ error: 'Token is invalid.' })
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment