Prefer `success_Json` over custom success JSON payload.

This commit is contained in:
Guo Xiang Tan 2018-02-15 07:46:33 +08:00
parent 218c8e8623
commit 96e5a7da46
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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