(rl => { const forceTOTP = () => { if (rl.settings.get('SetupTwoFactor')) { setTimeout(() => document.location.hash = '#/settings/two-factor-auth', 50); } }; addEventListener('rl-view-model', e => { if ('Login' === e.detail.viewModelTemplateID) { const container = e.detail.viewModelDom.querySelector('#plugin-Login-BottomControlGroup'), placeholder = 'PLUGIN_2FA/LABEL_TWO_FACTOR_CODE'; if (container) { container.prepend(Element.fromHTML('
' + '' + '' + '
')); } } }); // https://github.com/the-djmaze/snappymail/issues/349 addEventListener('sm-show-screen', e => { if ('settings' !== e.detail && rl.settings.get('SetupTwoFactor')) { e.preventDefault(); forceTOTP(); } }); })(window.rl);