mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
FIX: Improve UX for second factor enforcement. (#7207)
This commit is contained in:
@ -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))
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user