• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mgmodell / devise_token_auth_multi_email / #663

17 Mar 2026 01:12AM UTC coverage: 12.22% (-78.4%) from 90.649%
#663

push

mgmodell
switching back to mult-email

202 of 1653 relevant lines covered (12.22%)

0.39 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

31.82
/lib/devise_token_auth/url.rb
1
# frozen_string_literal: true
2

3
module DeviseTokenAuth::Url
1✔
4

5
  def self.generate(url, params = {})
1✔
6
    uri = URI(url)
×
7

8
    res = "#{uri.scheme}://#{uri.host}"
×
9
    res += ":#{uri.port}" if (uri.port && uri.port != 80 && uri.port != 443)
×
10
    res += uri.path.to_s if uri.path
×
11
    query = [uri.query, params.to_query].reject(&:blank?).join('&')
×
12
    res += "?#{query}"
×
13
    res += "##{uri.fragment}" if uri.fragment
×
14
    # repeat any query params after the fragment to deal with Angular eating any pre fragment query params, used
15
    # in the reset password redirect url
16
    res += "?#{query}" if uri.fragment
×
17

18
    res
×
19
  end
20

21
  def self.whitelisted?(url)
1✔
22
    url.nil? || \
×
23
      !!DeviseTokenAuth.redirect_whitelist.find do |pattern|
24
        !!Wildcat.new(pattern).match(url)
×
25
      end
26
  end
27

28
  # wildcard convenience class
29
  class Wildcat
1✔
30
    def self.parse_to_regex(str)
1✔
31
      escaped = Regexp.escape(str).gsub('\*','.*?')
×
32
      Regexp.new("^#{escaped}$", Regexp::IGNORECASE)
×
33
    end
34

35
    def initialize(str)
1✔
36
      @regex = self.class.parse_to_regex(str)
×
37
    end
38

39
    def match(str)
1✔
40
      !!@regex.match(str)
×
41
    end
42
  end
43

44
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc