2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-07 12:02:53 +08:00

SECURITY: Prevent users from updating to blacklisted email domains

This commit is contained in:
Robin Ward 2017-09-12 10:03:33 -04:00
parent 85ef3696de
commit 171d9e5aed
2 changed files with 13 additions and 2 deletions

View file

@ -1983,6 +1983,14 @@ describe UsersController do
expect(response).to_not be_success
end
it "raises an error when the email is blacklisted" do
user = Fabricate(:inactive_user)
SiteSetting.email_domains_blacklist = 'example.com'
session[SessionController::ACTIVATE_USER_KEY] = user.id
xhr :put, :update_activation_email, email: 'test@example.com'
expect(response).to_not be_success
end
it "can be updated" do
user = Fabricate(:inactive_user)
token = user.email_tokens.first