mirror of
https://github.com/discourse/discourse.git
synced 2025-02-10 13:24:55 +00:00
The `secondFactorMethod` property is defined as a @discourseComputed` which means it can't be overridden. Yet, we do override it in `app/assets/javascripts/discourse/app/components/security-key-form.js` and `app/assets/javascripts/discourse/app/components/second-factor-form.js` by doing `this.set("secondFactorMethod", ...)`. This commit sets a default property `secondFactorMethod` on the `email-login` controller after the model has been loaded. Given this property is no longer computed, it can be set again at other places. Followups: - Ideally we would follow DDAU pattern but this is quite a significant refactor. - The test I added is very limited, ideally we should start writing system specs for this, but it means having to deal with the email, it's a significant work.