diff --git a/app/assets/javascripts/discourse/app/services/restricted-routing.js b/app/assets/javascripts/discourse/app/services/restricted-routing.js index 133308698c4..998c988374a 100644 --- a/app/assets/javascripts/discourse/app/services/restricted-routing.js +++ b/app/assets/javascripts/discourse/app/services/restricted-routing.js @@ -43,7 +43,7 @@ export default class RestrictedRouting extends Service { // methods in ApplicationController. const enforcing2fa = (this.siteSettings.enforce_second_factor === "staff" && - this.currentUser.staff) || + this.currentUser?.staff) || this.siteSettings.enforce_second_factor === "all"; const exemptedFrom2faEnforcement =