Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Support for .cat TLD domains #20

wants to merge 1 commit into from

3 participants



I've added support for .cat TLD domains on Authentication.domain_tld_regex. See for more info.

Kind regards,


I know this is pretty old, but I'm wondering if anyone can comment on the logic behind listing out all supported tlds with more than 2 characters, rather than using something like "(?:[A-Z]{2,})" for the expression. Is there something horrible about that solution that I'm not seeing?


I'm not convinced that anyone is looking at the issues on this project, but in case someone does end up here, I raised a very similar ticket on someone else's fork, only I didn't just fix it for .cat - jeremydurham#1

@trejkaz trejkaz referenced this pull request in jeremydurham/restful-authentication

Email address regex was rejecting valid email addresses #1


I don't think this will get integrated after 3 years, so I'm closing it :P

@franciscoj franciscoj closed this

Well, as long as someone makes the obvious alternative improvement of just not restricting the TLD at all, I wouldn't object. (Incidentally, I didn't find it for .cat, there was some other domain a customer was actually using.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 4, 2010
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/authentication.rb
2  lib/authentication.rb
@@ -14,7 +14,7 @@ module Authentication
self.email_name_regex = '[\w\.%\+\-]+'.freeze
self.domain_head_regex = '(?:[A-Z0-9\-]+\.)+'.freeze
- self.domain_tld_regex = '(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|jobs|museum)'.freeze
+ self.domain_tld_regex = '(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|jobs|museum|cat)'.freeze
self.email_regex = /\A#{email_name_regex}@#{domain_head_regex}#{domain_tld_regex}\z/i
self.bad_email_message = "should look like an email address.".freeze
Something went wrong with that request. Please try again.