This repository has been archived on 2023-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
redmine-oauth2-a2/lib/helpers/checker.rb

12 lines
341 B
Ruby

module Helpers
module Checker
def allowed_domain_for? email
allowed_domains = Setting.plugin_redmine_oauth_a2[:allowed_domains]
return unless allowed_domains
allowed_domains = allowed_domains.split
return true if allowed_domains.empty?
allowed_domains.index(parse_email(email)[:domain])
end
end
end