mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
Add a link that allows you to send activation email again
This commit is contained in:
@ -27,7 +27,7 @@ class SessionController < ApplicationController
|
||||
render_serialized(@user, UserSerializer)
|
||||
return
|
||||
else
|
||||
render :json => {error: I18n.t("login.not_activated")}
|
||||
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}
|
||||
return
|
||||
end
|
||||
end
|
||||
|
@ -292,6 +292,16 @@ class UsersController < ApplicationController
|
||||
render :layout => 'no_js'
|
||||
end
|
||||
|
||||
def send_activation_email
|
||||
@user = fetch_user_from_params
|
||||
@email_token = @user.email_tokens.unconfirmed.active.first
|
||||
if @user
|
||||
@email_token = @user.email_tokens.create(email: @user.email) if @email_token.nil?
|
||||
Jobs.enqueue(:user_email, type: :signup, user_id: @user.id, email_token: @email_token.token)
|
||||
end
|
||||
render nothing: true
|
||||
end
|
||||
|
||||
def search_users
|
||||
term = params[:term].to_s.strip
|
||||
topic_id = params[:topic_id]
|
||||
|
Reference in New Issue
Block a user