Fix bug
This commit is contained in:
parent
21f1a0468a
commit
b574170de4
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue