summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLogan Fick <logaldeveloper@protonmail.com>2017-12-17 14:05:13 -0500
committerLogan Fick <logaldeveloper@protonmail.com>2017-12-17 14:05:13 -0500
commitdf84114af2c1267b150504fa2bdbfb5139b96fd6 (patch)
treed76e7fe9a5e8cbba5e03c4f357dcb9b3fdfb4822 /app
parent3d260f9de0b2a28581e37b5f7ff8565d715f87ec (diff)
Fixed rare circumstances causing internal server error when trying to sign up.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/users_controller.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index e86db8b..85e1613 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -93,6 +93,12 @@ class UsersController < ApplicationController
@user.uuid = user_profile["id"]
@user.ign = user_profile["name"] # correct case
+ if User.find_by(uuid: @user.uuid)
+ flash[:alert] = "You already have a Redstoner account associated with this Minecraft account. Please log in instead."
+ redirect_to login_path
+ return
+ end
+
if validate_token(@user.uuid, @user.email, params[:registration_token])
destroy_token(params[:email])
@user.last_ip = request.remote_ip # showing in mail