mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: prevent anonymous users from changing their email/username/name (#7311)
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user