mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: inform users if forgot password works or not
FIX: flash dialog in forgot password often had wrong color (this can be disabled by setting forgot_password_verbose to false)
This commit is contained in:
@ -108,8 +108,13 @@ class SessionController < ApplicationController
|
||||
email_token = user.email_tokens.create(email: user.email)
|
||||
Jobs.enqueue(:user_email, type: :forgot_password, user_id: user.id, email_token: email_token.token)
|
||||
end
|
||||
# always render of so we don't leak information
|
||||
render json: {result: "ok"}
|
||||
|
||||
json = { result: "ok" }
|
||||
if SiteSetting.forgot_password_verbose
|
||||
json[:user_found] = user.present?
|
||||
end
|
||||
|
||||
render json: json
|
||||
|
||||
rescue RateLimiter::LimitExceeded
|
||||
render_json_error(I18n.t("rate_limiter.slow_down"))
|
||||
|
Reference in New Issue
Block a user