From 96e5a7da46b75827ecc989483ced6f262b0d3bf7 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Thu, 15 Feb 2018 07:46:33 +0800 Subject: [PATCH] Prefer `success_Json` over custom success JSON payload. --- app/controllers/session_controller.rb | 2 +- app/controllers/users_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb index 079ba724efb..8b0e0f243c0 100644 --- a/app/controllers/session_controller.rb +++ b/app/controllers/session_controller.rb @@ -261,7 +261,7 @@ class SessionController < ApplicationController Jobs.enqueue(:critical_user_email, type: :forgot_password, user_id: user.id, email_token: email_token.token) end - json = { result: "ok" } + json = success_json unless SiteSetting.hide_email_address_taken json[:user_found] = user_presence end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 613215df520..4d0726d865a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -609,7 +609,7 @@ class UsersController < ApplicationController end end - json = { result: "ok" } + json = success_json json[:user_found] = user_presence unless SiteSetting.hide_email_address_taken render json: json rescue RateLimiter::LimitExceeded