FIX: Improve UX for second factor enforcement. (#7207)

This commit is contained in:
Bianca Nenciu
2019-03-20 06:40:25 +02:00
committed by Sam
parent c72a60896c
commit 50e9a66e89
5 changed files with 31 additions and 23 deletions

View File

@ -746,6 +746,15 @@ const User = RestModel.extend({
} else {
$.removeCookie("text_size", { path: "/", expires: 1 });
}
},
@computed("second_factor_enabled", "staff")
enforcedSecondFactor(secondFactorEnabled, staff) {
const enforce = Discourse.SiteSettings.enforce_second_factor;
return (
!secondFactorEnabled &&
(enforce === "all" || (enforce === "staff" && staff))
);
}
});