Implement sessions/create in JSON API

This commit is contained in:
Thibault Jouan
2012-02-26 11:16:52 +00:00
parent 499b06c9e5
commit 5dfafdcc46
6 changed files with 103 additions and 0 deletions

View File

@@ -1,4 +1,7 @@
class Api::ApplicationController < ApplicationController
skip_before_filter :verify_authenticity_token
skip_before_filter :authenticate!, :only => [:cor_preflight]
before_filter :cor_filter
def cor_filter
@@ -12,4 +15,8 @@ class Api::ApplicationController < ApplicationController
head :ok
end
def authenticate!
head :unauthorized if current_user.nil?
end
end