diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index ff2a6adf3..3c4b7b7cf 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -134,11 +134,11 @@ class AccountController < ApplicationController # Token based account activation def activate - redirect_to(home_url) && return unless Setting.self_registration? && params[:token].present? + (redirect_to(home_url); return) unless Setting.self_registration? && params[:token].present? token = Token.find_by_action_and_value('register', params[:token].to_s) - redirect_to(home_url) && return unless token and !token.expired? + (redirect_to(home_url); return) unless token and !token.expired? user = token.user - redirect_to(home_url) && return unless user.registered? + (redirect_to(home_url); return) unless user.registered? user.activate if user.save token.destroy