i just read meteor's accounts config options, "restrictCreationByEmailDomain" option is awesome
Accounts.config({ restrictCreationByEmailDomain: 'school.edu' })
i want to know can i use a list of domains separated by comma or array in place of 'school.edu' is there any simple tutorial for meteor accounts system ? pls help
From Setup, in the Quick Find box, enter User Management Settings , and then select User Management Settings. Turn on Email Domain Allowlist.
A domain name (often simply called a domain) is an easy-to-remember name that's associated with a physical IP address on the Internet. It's the unique name that appears after the @ sign in email addresses, and after www. in web addresses.
restrictCreationByEmailDomain String Or Function
If set, only allow new users with an email in the specified domain or if the predicate function returns true. Works with password-based sign-in and external services that expose email addresses (Google, Facebook, GitHub).
Accounts.config({
restrictCreationByEmailDomain: function(email) {
var domain = email.slice(email.lastIndexOf("@")+1); // or regex
var allowed = ["school.edu", "school.edu.br"];
return _.contains(allowed, domain);
},
...
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With