FIX: prevent anonymous users from changing their email/username/name (#7311)

This commit is contained in:
Maja Komel
2019-04-17 10:05:02 +02:00
committed by Sam
parent a8f410a9c5
commit 5c795bc480
5 changed files with 76 additions and 14 deletions

View File

@ -1,12 +1,13 @@
moduleFor("controller:preferences/account");
QUnit.skip("updating of associated accounts", function(assert) {
QUnit.test("updating of associated accounts", function(assert) {
const controller = this.subject({
siteSettings: {
enable_google_oauth2_logins: true
},
model: Ember.Object.create({
second_factor_enabled: true
second_factor_enabled: true,
is_anonymous: true
}),
site: Ember.Object.create({
isMobileDevice: false
@ -21,6 +22,10 @@ QUnit.skip("updating of associated accounts", function(assert) {
assert.equal(controller.get("canUpdateAssociatedAccounts"), false);
controller.set("model.is_anonymous", false);
assert.equal(controller.get("canUpdateAssociatedAccounts"), false);
controller.set("canCheckEmails", true);
assert.equal(controller.get("canUpdateAssociatedAccounts"), true);