mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Fix a problem where you might see missing {{sentTo}} value after a failed login
This commit is contained in:
@ -27,7 +27,12 @@ class SessionController < ApplicationController
|
|||||||
render_serialized(@user, UserSerializer)
|
render_serialized(@user, UserSerializer)
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
render json: {error: I18n.t("login.not_activated"), reason: 'not_activated', sent_to_email: @user.email_logs.where(email_type: 'signup').order('created_at DESC').first.try(:to_address), current_email: @user.email}
|
render json: {
|
||||||
|
error: I18n.t("login.not_activated"),
|
||||||
|
reason: 'not_activated',
|
||||||
|
sent_to_email: @user.email_logs.where(email_type: 'signup').order('created_at DESC').first.try(:to_address) || @user.email,
|
||||||
|
current_email: @user.email
|
||||||
|
}
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user