X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c3498b490b7e695f0be0898e3df76961bda4738e..ad2739347b5fc7c57d8b7131580fda10cc77f108:/app/models/user.rb diff --git a/app/models/user.rb b/app/models/user.rb index 7faf748cd..958a03a98 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -124,6 +124,14 @@ class User < ApplicationRecord before_save :update_tile after_save :spam_check + generates_token_for :new_email, :expires_in => 1.week do + fingerprint + end + + generates_token_for :password_reset, :expires_in => 1.week do + fingerprint + end + def display_name_cannot_be_user_id_with_other_id display_name&.match(/^user_(\d+)$/i) do |m| errors.add :display_name, I18n.t("activerecord.errors.messages.display_name_is_user_n") unless m[1].to_i == id