class Lato::AccountController

def destroy_action

def destroy_action
  respond_to do |format|
    if @session.user.destroy_with_confirmation(params.require(:user).permit(:email_confirmation))
      session_destroy
      format.html { redirect_to lato.root_path }
      format.json { render json: {} }
    else
      format.html { render :index, status: :unprocessable_entity }
      format.json { render json: @session.user.errors, status: :unprocessable_entity }
    end
  end
end