Fixed rare circumstances causing internal server error when trying to sign up.

This commit is contained in:
Logan Fick
2017-12-17 14:05:13 -05:00
parent 3d260f9de0
commit df84114af2

View File

@@ -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