staart / api

🏁🛠️ SaaS backend & API framework based on @nestjs
https://staart.js.org/api
MIT License
1.08k stars 202 forks source link

Feature: Restricting the list of allowable domains #114

Closed cloudkompute closed 5 years ago

cloudkompute commented 5 years ago

Email domain: Enter your company's domain, eg. oswaldlabs.com We'll allow people with emails from this domain to join this organization automatically

Do not allow the public domains to be included in this list like gmail, hotmail, rediffmail, and many others.

issue-label-bot[bot] commented 5 years ago

Issue-Label Bot is automatically applying the label feature_request to this issue, with a confidence of 0.95. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

cloudkompute commented 5 years ago

A super-admin could be probably allowed to maintain the names of the restricted domains.

AnandChowdhary commented 5 years ago

Good plan! There are quite a few nice NPM packages for this, I'll make sure to add that validation. The feature of email restriction actually doesn't work, it's currently just a setting you can save, but I plan on shipping that this week too.

We already have a helper function for detecting educational emails using my package Edumail, and something similar can be used to prevent free/temporary/disposable email addresses too.

AnandChowdhary commented 5 years ago

I've added a Staart-wide check for disposable emails while signing up or inviting a member. You can use the environment variable ALLOW_DISPOSABLE_EMAILS to control the setting. By default, disposable emails are not allowed.

For teams and company domain emails, I will make sure also not allow public email providers like Gmail, that's in the works! 😄

cloudkompute commented 5 years ago

Great!

I'd like to request to create a super-admin role that controls the list of restrictive domains like gmail, etc.

AnandChowdhary commented 5 years ago

Staart now has support for whitelisted domains:

Screen Shot 2019-07-22 at 14 36 11

You can add any number of domains to your team, and verify them by uploading a file or adding a DNS TXT record:

Screen Shot 2019-07-22 at 14 45 23

Then, you can choose to:

  1. Only allow managers to invite members from approved domains, and
  2. Automatically let users with an email on that domain to join your team