forked from gitlabhq/gitlabhq
-
Notifications
You must be signed in to change notification settings - Fork 0
Modify accepted email domains for devise
agustinus-ap edited this page Apr 18, 2012
·
1 revision
After customize email_regex of devise, know gitlabhq have email domain validation. So how we could add and/or remove the email domains? Follow these steps to modify which are accepted email domains:
-
Open
config/initializers/devise.rband finddomainsvariable.domains = %w(kiranatama.com) config.email_regex = Regexp.new "\\A[^@]+@(#{domains.join('|')})\\z", true -
Next modify domains value as you wish, for example if you wish to add
wgs.co.idthen writedomains = %w(kiranatama.com wgs.co.id) -
Whenever you change a configuration file, make sure you've restart the application before try it again.
And voila, next time you register an user with wgs.co.id email domain it won't reject you anymore.