From f4f5d5744cc064a3612d87bb885061d5a09d96f3 Mon Sep 17 00:00:00 2001 From: cktricky Date: Wed, 12 Mar 2014 13:24:37 -0400 Subject: [PATCH] working on the auth structure for the API --- app/controllers/api/v1/users_controller.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb index 2afc41e..5f59b33 100644 --- a/app/controllers/api/v1/users_controller.rb +++ b/app/controllers/api/v1/users_controller.rb @@ -1,11 +1,20 @@ class Api::V1::UsersController < ApplicationController skip_before_filter :authenticated - + before_filter :valid_api_token + respond_to :json - def index - respond_with ({:hi => :world}) + def valid_api_token + authenticate_or_request_with_http_token do |token, options| + # TODO :add some functionality to check if the HTTP Header is valid + return true + end end - + + def index + respond_with User.all + end + + end