ruby on rails - How can I use Devise Authentication to validate that a sign up email address is from certain domain? -
i make sure people email address of domain can signup site using devise.
for instance if people sign-up email joe@mysite.com, should confirmation email if sign joe@yoursite.com, should error message.
uncommenting line in config/initializers/devise.rb
# regex use validate email address # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
and changing use domain wanted limit to:
config.email_regexp = /\a([\w\.%\+\-]+)@mysite\.com\z/i
did trick.
Comments
Post a Comment