diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index e843e0a..7e914fc 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -90,8 +90,7 @@ class UsersController < ApplicationController @user.uuid = user_profile["id"] @user.ign = user_profile["name"] # correct case - # TODO: uncomment when MC part works - if true # validate_token(@user.uuid, @user.email, params[:registration_token]) + if true validate_token(@user.uuid, @user.email, params[:registration_token]) @user.last_ip = request.remote_ip # showing in mail if @user.save session[:user_id] = @user.id diff --git a/app/models/user.rb b/app/models/user.rb index 7b7b297..ccdb8e7 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -18,7 +18,7 @@ class User < ActiveRecord::Base validates_length_of :about, maximum: 5000 validates_length_of :ign, minimum: 1, maximum: 16 - validates :email, uniqueness: {case_sensitive: false}, format: {with: /\A.+@(.+\..{2,}|\[[0-9:.]+\])\z/i, message: "That doesn't look like an email adress."} + validates :email, uniqueness: {case_sensitive: false}, format: {with: /\A.+@(.+\..{2,}|\[[0-9a-f:.]+\])\z/i, message: "That doesn't look like an email adress."} validates :ign, uniqueness: {case_sensitive: false}, format: {with: /\A[a-z\d_]+\z/i, message: "Username is invalid (a-z, 0-9, _)."} validate :account_exists?, :if => lambda {|user| user.ign_changed? } diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index bf7ec55..03a507d 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -1,6 +1,6 @@
To get a token, join the Minecraft server (redstoner.com) and use the /token <your-email> command.
To get your token, join the Minecraft server (redstoner.com) and use the /token command.
<%= form_for @user do |f| %>