app/controllers/cadenero/v1/account/sessions_controller.rb in cadenero-0.0.2.b2 vs app/controllers/cadenero/v1/account/sessions_controller.rb in cadenero-0.0.2.b3
- old
+ new
@@ -5,10 +5,10 @@
class Account::SessionsController < Cadenero::ApplicationController
# create the session for the user using the password strategy and returning the user JSON
def create
if env['warden'].authenticate(:password, :scope => :user)
#return the user JSON on success
- render json: current_user, status: :created
+ render json: current_user, serializer: Cadenero::UserSerializer, status: :created
else
#return error mesage in a JSON on error
render json: {errors: {user:["Invalid email or password"]}}, status: :unprocessable_entity
end
end