Skip to content
Snippets Groups Projects
Commit aec51e40 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Make account domains case-insensitive, downcase before checking against local

parent 5f737c72
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ class TagManager
end
def local_domain?(domain)
domain.nil? || domain.gsub(/[\/]/, '') == Rails.configuration.x.local_domain
domain.nil? || domain.gsub(/[\/]/, '').downcase == Rails.configuration.x.local_domain.downcase
end
def uri_for(target)
......
......@@ -125,7 +125,7 @@ class Account < ApplicationRecord
end
def self.find_remote!(username, domain)
where(arel_table[:username].matches(username)).where(domain: domain).take!
where(arel_table[:username].matches(username)).where(domain.nil? ? { domain: nil } : arel_table[:domain].matches(domain)).take!
end
def self.find_local(username)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment