diff --git a/app/models/token.rb b/app/models/token.rb index 4c0598e60d6..915fcbae7be 100644 --- a/app/models/token.rb +++ b/app/models/token.rb @@ -41,7 +41,7 @@ def self.destroy_expired def self.find_active_user(action, key, validity_days=nil) action = action.to_s key = key.to_s - return nil unless action.present? && key =~ /\A[a-f0-9]+\z/ + return nil unless action.present? && !key.match('\A[a-zA-Z0-9]+\Z').nil? token = find_by_action_and_value(action, key) if token && token.user && token.user.active?