raise not found if user is not found

This commit is contained in:
Sam 2014-09-25 17:45:45 +10:00
parent 8f8ea735ee
commit a901d682fe

View file

@ -330,6 +330,9 @@ class UsersController < ApplicationController
RateLimiter.new(nil, "activate-min-#{request.remote_ip}", 6, 1.minute).performed!
@user = User.find_by_username_or_email(params[:username].to_s)
raise Discourse::NotFound unless @user
@email_token = @user.email_tokens.unconfirmed.active.first
enqueue_activation_email if @user
render nothing: true