diff --git a/app/lib/services/domain_ownership_service.rb b/app/lib/services/domain_ownership_service.rb index 70e594e..1035e37 100644 --- a/app/lib/services/domain_ownership_service.rb +++ b/app/lib/services/domain_ownership_service.rb @@ -2,7 +2,7 @@ module Services class DomainOwnershipService def authorize!(identity, cert_req) cert_req.fqdns.each do |fqdn| - domain = get_domain_name(fqdn) + domain = Domain.where(fqdn: fqdn).first raise AuthError unless domain.present? && (domain.owner == identity.subject || (domain.group_delegation && @@ -10,11 +10,5 @@ def authorize!(identity, cert_req) end nil end - - private - - def get_domain_name(fqdn) - Domain.where(fqdn: fqdn).first - end end end