Admin panel allow all emails option #41
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #15
Closes #15
This PR is dependent on #40, since it builds on code in that PR.
Making another contribution for Hacktoberfest, which completes #15.
I added a new checkbox called 'Allow all emails' to the 'Additional Options' section on the admin settings page.
Toggling this will update a new boolean property called
allowAllEmails
in the server's Settings schema,and update the settings client side. A 'put' endpoint was added to the server api.js to allow changes to the
allowAllEmails
setting.Upon new user registration, the UserController validation that occurs server side now checks the settings for
allowAllEmails
flag after validating that the email is a valid email type. IfallowAllEmails
is set totrue
, then the whitelist will not be checked for valid educational emails.If the
allowAllEmails
flag is set tofalse
, then the whitelist validation proceeds as normal.I did my best to remain consistent with the codebase, and added as little as possible to get this working. Please don't hesitate to let me know if you'd like this done differently. Thanks!
Example Screenshots:
Additional options section.
Allow all emails set to disallowed.
This is what it looks like when toggled to 'allowed'.
This is the confirmation that pops up after you toggle the checkbox.