working on the auth structure for the API
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user