johnhamelink
3/26/2015 - 4:29 PM

sessions_controller.rb

class SessionsController < Devise::SessionsController
  skip_before_filter  :verify_authenticity_token
  respond_to :json

  def create
    super do |user|

      data = {
        token: user.authentication_token,
        email: user.email,
        user_id: user.id
      }

      render json: data, status: 201 and return
    end
  end
end