This commit is contained in:
Erik Michaels-Ober 2011-04-03 06:56:51 -07:00
parent 21f1a0468a
commit b574170de4
1 changed files with 1 additions and 3 deletions

View File

@ -1,11 +1,9 @@
class SessionsController < Devise::SessionsController class SessionsController < Devise::SessionsController
respond_to :json
def create def create
resource = warden.authenticate(:scope => resource_name) resource = warden.authenticate(:scope => resource_name)
if resource if resource
sign_in(resource_name, resource) sign_in(resource_name, resource)
respond_with resource render(:json => resource)
else else
render(:json => {"errors" => {:password => ["You need to sign in or sign up before continuing."]}}) render(:json => {"errors" => {:password => ["You need to sign in or sign up before continuing."]}})
end end