diff --git a/js/dist/forum.js b/js/dist/forum.js index 463d301..616c935 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={n:o=>{var a=o&&o.__esModule?()=>o.default:()=>o;return t.d(a,{a}),a},d:(o,a)=>{for(var r in a)t.o(a,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:a[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o),t.d(o,{extend:()=>Z});const a=flarum.core.compat["common/app"];t.n(a)().initializers.add("ianm/twofactor",(function(){}));const r=flarum.core.compat["forum/app"];var n=t.n(r);const e=flarum.core.compat["common/extend"],i=flarum.core.compat["forum/components/UserSecurityPage"];var s=t.n(i);function c(t,o){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},c(t,o)}function l(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,c(t,o)}const u=flarum.core.compat["common/Component"];var d=t.n(u);const f=flarum.core.compat["common/components/Button"];var p=t.n(f);const h=flarum.core.compat["common/utils/ItemList"];var b=t.n(h);const w=flarum.core.compat["common/helpers/listItems"];var y=t.n(w);const v=flarum.core.compat["common/helpers/icon"];var _=t.n(v),F=function(t){function o(){return t.apply(this,arguments)||this}return l(o,t),o.prototype.view=function(){var t=this.attrs,o=t.icon,a=t.title,r=t.value,n=t.action,e=t.helpText;return m("li",{className:"TwoFactorGrid-item"},m("span",{className:"TwoFactorGrid-icon"},_()(o)),m("div",{className:"TwoFactorGrid-content"},m("span",{className:"TwoFactorGrid-title"},a),m("span",{className:"TwoFactorGrid-value"},r),e&&m("span",{className:"helpText TwoFactorGrid-helpText"},e)),n&&m("span",{className:"TwoFactorGrid-actions"},n))},o}(d());const g=flarum.core.compat["common/components/Tooltip"];var T=t.n(g);const k=flarum.core.compat["common/components/Modal"];var N=t.n(k);const E=flarum.core.compat["common/utils/Stream"];var q=t.n(E);const x=flarum.core.compat["common/components/LoadingIndicator"];var B=t.n(x),C=function(t){function o(){return t.apply(this,arguments)||this}l(o,t);var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.user=this.attrs.user,this.status="loading",this.qrCodeUrl=null,this.backupCodes=[],this.token=q()(""),this.code=null,this.activeTab="qrcode"},a.className=function(){return"TwoFactorEnableModal Modal--small"},a.title=function(){return n().translator.trans("ianm-twofactor.forum.security.two_factor_heading")},a.oncreate=function(o){var a=this;t.prototype.oncreate.call(this,o);var r=this.user.id();n().request({method:"GET",url:n().forum.attribute("apiUrl")+"/users/"+r+"/twofactor/qrcode"}).then((function(t){a.qrCodeUrl=t.svg,a.code=t.code,a.status="displayQR",m.redraw()}))},a.onupdate=function(){var t=document.querySelector(".TwoFactorEnableModal [name=token]");t&&document.activeElement!==t&&t.focus()},a.content=function(){var t=this;return m("div",{className:"Modal-body"},"loading"===this.status&&m("div",{className:"loading"},m(B(),null),m("p",null,n().translator.trans("ianm-twofactor.forum.security.loading_qr"))),"displayQR"===this.status&&m("div",null,m("div",{className:"tabs"},m(p(),{className:"qrcode"===this.activeTab?"active":"",onclick:function(){t.activeTab="qrcode",m.redraw()}},n().translator.trans("ianm-twofactor.forum.security.qr_tab")),m(p(),{className:"manual"===this.activeTab?"active":"",onclick:function(){t.activeTab="manual",m.redraw()}},n().translator.trans("ianm-twofactor.forum.security.manual_tab"))),"qrcode"===this.activeTab&&m("div",{className:"qrSection"},m("img",{className:"qrImage",src:this.qrCodeUrl,alt:n().translator.trans("ianm-twofactor.forum.security.qr_code_alt")}),m("p",{className:"helpText"},n().translator.trans("ianm-twofactor.forum.security.scan_qr_instruction"))),"manual"===this.activeTab&&m("div",{className:"manualEntrySection"},m("code",{className:"manualEntryCode"},this.code),m("p",{className:"helpText"},n().translator.trans("ianm-twofactor.forum.security.manual_entry_instruction"))),m("div",{className:"Form"},m("form",{onsubmit:this.onSubmit.bind(this)},m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"token",bidi:this.token,placeholder:n().translator.trans("ianm-twofactor.forum.security.enter_token")})),m("div",{className:"Form-group"},m(p(),{type:"submit",className:"Button Button--primary",onclick:this.verifyToken.bind(this)},n().translator.trans("ianm-twofactor.forum.security.verify_button")))))),"displayBackupCodes"===this.status&&m("div",null,m("p",null,n().translator.trans("ianm-twofactor.forum.security.backup_codes")),m("ul",null,this.backupCodes.map((function(t){return m("li",null,m("code",null,t))}))),m("p",null,n().translator.trans("ianm-twofactor.forum.security.backup_codes_instruction")),m(p(),{className:"Button Button--primary",onclick:function(){t.status="final",m.redraw()}},n().translator.trans("ianm-twofactor.forum.security.saved_backup_codes_button"))),"final"===this.status&&m("div",null,m("p",null,n().translator.trans("ianm-twofactor.forum.security.two_factor_enabled_confirmation")),m(p(),{className:"Button Button--primary",onclick:this.finish.bind(this)},n().translator.trans("ianm-twofactor.forum.security.ok_button"))))},a.verifyToken=function(){var t=this;n().request({method:"POST",url:n().forum.attribute("apiUrl")+"/users/twofactor/verify",body:{token:this.token()}}).then((function(o){t.backupCodes=o.backupCodes,t.status="displayBackupCodes",t.user.twoFactorEnabled(!0),m.redraw()})).catch((function(t){}))},a.finish=function(){this.attrs.onEnabled(),this.hide()},a.onSubmit=function(t){t.preventDefault(),this.verifyToken()},o}(N()),A=function(t){function o(){return t.apply(this,arguments)||this}l(o,t);var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!1},a.className=function(){return"TwoFactorDisableConfirmModal Modal--small"},a.title=function(){return n().translator.trans("ianm-twofactor.forum.security.confirm_disable_2fa_title")},a.content=function(){return m("div",{className:"Modal-body"},m("p",null,n().translator.trans("ianm-twofactor.forum.security.confirm_disable_2fa_text")),m("div",{className:"Form-group"},m(p(),{className:"Button Button--danger",onclick:this.disable.bind(this),loading:this.loading},n().translator.trans("ianm-twofactor.forum.security.disable_2fa_button")),m(p(),{className:"Button Button--cancel",onclick:this.hide.bind(this)},n().translator.trans("ianm-twofactor.forum.security.cancel_button"))))},a.disable=function(){var t=this;this.loading=!0;var o=this.attrs.user.id();n().request({method:"DELETE",url:n().forum.attribute("apiUrl")+"/users/"+o+"/twofactor/disable"}).then((function(){t.loading=!1,t.attrs.onDisabled(),t.hide()})).catch((function(t){}))},o}(N()),D=function(t){function o(){return t.apply(this,arguments)||this}l(o,t);var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.user=this.attrs.user,this.twoFactorEnabled=this.user.twoFactorEnabled(),this.canDisableTwoFactor=this.user.canDisable2FA(),this.backupCodesRemaining=this.user.backupCodesRemaining()||0},a.view=function(){return m("div",{className:"TwoFactorGrid"},m("ul",null,y()(this.twoFactorItems().toArray())))},a.twoFactorItems=function(){var t=new(b()),o=this.getDisableAction(),a=m(p(),{className:"Button Button--primary",onclick:this.enableTwoFactor.bind(this)},n().translator.trans("ianm-twofactor.forum.security.enable_2fa_button"));return t.add("status",m(F,{icon:"fas fa-shield-alt",title:n().translator.trans("ianm-twofactor.forum.security.two_factor_title"),value:this.twoFactorEnabled?n().translator.trans("ianm-twofactor.forum.security.two_factor_enabled"):n().translator.trans("ianm-twofactor.forum.security.two_factor_disabled"),action:this.twoFactorEnabled?o:a,helpText:!this.canDisableTwoFactor&&n().translator.trans("ianm-twofactor.forum.security.cannot_disable")})),this.twoFactorEnabled?(t.add("backupCodes",m(F,{icon:"fas fa-key",title:n().translator.trans("ianm-twofactor.forum.security.backup_codes_remaining"),value:this.backupCodesRemaining})),t):t},a.getDisableAction=function(){var t=m(p(),{className:"Button Button--danger",onclick:this.disableTwoFactor.bind(this),disabled:!this.canDisableTwoFactor},n().translator.trans("ianm-twofactor.forum.security.disable_2fa_button"));return this.canDisableTwoFactor?t:m(T(),{text:n().translator.trans("ianm-twofactor.forum.security.cannot_disable_tooltip")},t)},a.enableTwoFactor=function(){n().modal.show(C,{onEnabled:this.onTwoFactorEnabled.bind(this),user:this.user})},a.onTwoFactorEnabled=function(){this.twoFactorEnabled=!0,m.redraw()},a.disableTwoFactor=function(){n().modal.show(A,{onDisabled:this.onTwoFactorDisabled.bind(this),user:this.user})},a.onTwoFactorDisabled=function(){this.twoFactorEnabled=!1,m.redraw()},a.generateBackupCodes=function(){m.redraw()},o}(d()),M=function(t){function o(){return t.apply(this,arguments)||this}l(o,t);var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.twoFactorEnabled=this.attrs.user.twoFactorEnabled(),this.canDisableTwoFactor=this.attrs.user.canDisable2FA(),this.loading=!1},a.view=function(){return m("div",null,m(D,{user:this.attrs.user}))},o}(d());const O=flarum.core.compat["common/components/FieldSet"];var S=t.n(O);const G=flarum.core.compat["common/components/LinkButton"];var j=t.n(G);const P=flarum.core.compat["forum/components/LogInModal"];var I=t.n(P);const R=flarum.core.compat["forum/ForumApplication"];var U=t.n(R);function L(){return L=Object.assign?Object.assign.bind():function(t){for(var o=1;o').insertBefore("#content")[0];m.mount(n,{view:function(){return m(r,{dismissible:!1,controls:[m(a,null)],className:"Alert--2faEnable"},t.translator.trans("ianm-twofactor.forum.user_2fa.alert_message"))}})}}(n())}))}))})(),module.exports=o})(); +(()=>{var t={n:o=>{var a=o&&o.__esModule?()=>o.default:()=>o;return t.d(a,{a}),a},d:(o,a)=>{for(var r in a)t.o(a,r)&&!t.o(o,r)&&Object.defineProperty(o,r,{enumerable:!0,get:a[r]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o),t.d(o,{extend:()=>Z});const a=flarum.core.compat["common/app"];t.n(a)().initializers.add("ianm/twofactor",(function(){}));const r=flarum.core.compat["forum/app"];var n=t.n(r);const e=flarum.core.compat["common/extend"],i=flarum.core.compat["forum/components/UserSecurityPage"];var s=t.n(i);function c(t,o){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},c(t,o)}function l(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,c(t,o)}const u=flarum.core.compat["common/Component"];var d=t.n(u);const f=flarum.core.compat["common/components/Button"];var p=t.n(f);const h=flarum.core.compat["common/utils/ItemList"];var b=t.n(h);const w=flarum.core.compat["common/helpers/listItems"];var v=t.n(w);const y=flarum.core.compat["common/helpers/icon"];var _=t.n(y),F=function(t){function o(){return t.apply(this,arguments)||this}return l(o,t),o.prototype.view=function(){var t=this.attrs,o=t.icon,a=t.title,r=t.value,n=t.action,e=t.helpText;return m("li",{className:"TwoFactorGrid-item"},m("span",{className:"TwoFactorGrid-icon"},_()(o)),m("div",{className:"TwoFactorGrid-content"},m("span",{className:"TwoFactorGrid-title"},a),m("span",{className:"TwoFactorGrid-value"},r),e&&m("span",{className:"helpText TwoFactorGrid-helpText"},e)),n&&m("span",{className:"TwoFactorGrid-actions"},n))},o}(d());const g=flarum.core.compat["common/components/Tooltip"];var T=t.n(g);const k=flarum.core.compat["common/components/Modal"];var N=t.n(k);const E=flarum.core.compat["common/utils/Stream"];var q=t.n(E);const x=flarum.core.compat["common/components/LoadingIndicator"];var B=t.n(x),C=function(t){function o(){return t.apply(this,arguments)||this}l(o,t);var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.user=this.attrs.user,this.status="loading",this.qrCodeUrl=null,this.backupCodes=[],this.token=q()(""),this.code=null,this.activeTab="qrcode"},a.className=function(){return"TwoFactorEnableModal Modal--small"},a.title=function(){return n().translator.trans("ianm-twofactor.forum.security.two_factor_heading")},a.oncreate=function(o){var a=this;t.prototype.oncreate.call(this,o);var r=this.user.id();n().request({method:"GET",url:n().forum.attribute("apiUrl")+"/users/"+r+"/twofactor/qrcode"}).then((function(t){a.qrCodeUrl=t.svg,a.code=t.code,a.status="displayQR",m.redraw()}))},a.onupdate=function(){var t=document.querySelector(".TwoFactorEnableModal [name=token]");t&&document.activeElement!==t&&t.focus()},a.content=function(){var t=this;return m("div",{className:"Modal-body"},"loading"===this.status&&m("div",{className:"loading"},m(B(),null),m("p",null,n().translator.trans("ianm-twofactor.forum.security.loading_qr"))),"displayQR"===this.status&&m("div",null,m("div",{className:"tabs"},m(p(),{className:"qrcode"===this.activeTab?"active":"",onclick:function(){t.activeTab="qrcode",m.redraw()}},n().translator.trans("ianm-twofactor.forum.security.qr_tab")),m(p(),{className:"manual"===this.activeTab?"active":"",onclick:function(){t.activeTab="manual",m.redraw()}},n().translator.trans("ianm-twofactor.forum.security.manual_tab"))),"qrcode"===this.activeTab&&m("div",{className:"qrSection"},m("img",{className:"qrImage",src:this.qrCodeUrl,alt:n().translator.trans("ianm-twofactor.forum.security.qr_code_alt")}),m("p",{className:"helpText"},n().translator.trans("ianm-twofactor.forum.security.scan_qr_instruction"))),"manual"===this.activeTab&&m("div",{className:"manualEntrySection"},m("code",{className:"manualEntryCode"},this.code),m("p",{className:"helpText"},n().translator.trans("ianm-twofactor.forum.security.manual_entry_instruction"))),m("div",{className:"Form"},m("form",{onsubmit:this.onSubmit.bind(this)},m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"token",bidi:this.token,placeholder:n().translator.trans("ianm-twofactor.forum.security.enter_token")})),m("div",{className:"Form-group"},m(p(),{type:"submit",className:"Button Button--primary",onclick:this.verifyToken.bind(this)},n().translator.trans("ianm-twofactor.forum.security.verify_button")))))),"displayBackupCodes"===this.status&&m("div",null,m("p",null,n().translator.trans("ianm-twofactor.forum.security.backup_codes")),m("ul",null,this.backupCodes.map((function(t){return m("li",null,m("code",null,t))}))),m("p",null,n().translator.trans("ianm-twofactor.forum.security.backup_codes_instruction")),m(p(),{className:"Button Button--primary",onclick:function(){t.status="final",m.redraw()}},n().translator.trans("ianm-twofactor.forum.security.saved_backup_codes_button"))),"final"===this.status&&m("div",null,m("p",null,n().translator.trans("ianm-twofactor.forum.security.two_factor_enabled_confirmation")),m(p(),{className:"Button Button--primary",onclick:this.finish.bind(this)},n().translator.trans("ianm-twofactor.forum.security.ok_button"))))},a.verifyToken=function(){var t=this;n().request({method:"POST",url:n().forum.attribute("apiUrl")+"/users/twofactor/verify",body:{token:this.token()}}).then((function(o){t.backupCodes=o.backupCodes,t.status="displayBackupCodes",t.user.twoFactorEnabled(!0),m.redraw()})).catch((function(t){}))},a.finish=function(){this.attrs.onEnabled(),this.hide()},a.onSubmit=function(t){t.preventDefault(),this.verifyToken()},o}(N()),A=function(t){function o(){return t.apply(this,arguments)||this}l(o,t);var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.loading=!1},a.className=function(){return"TwoFactorDisableConfirmModal Modal--small"},a.title=function(){return n().translator.trans("ianm-twofactor.forum.security.confirm_disable_2fa_title")},a.content=function(){return m("div",{className:"Modal-body"},m("p",null,n().translator.trans("ianm-twofactor.forum.security.confirm_disable_2fa_text")),m("div",{className:"Form-group"},m(p(),{className:"Button Button--danger",onclick:this.disable.bind(this),loading:this.loading},n().translator.trans("ianm-twofactor.forum.security.disable_2fa_button")),m(p(),{className:"Button Button--cancel",onclick:this.hide.bind(this)},n().translator.trans("ianm-twofactor.forum.security.cancel_button"))))},a.disable=function(){var t=this;this.loading=!0;var o=this.attrs.user.id();n().request({method:"DELETE",url:n().forum.attribute("apiUrl")+"/users/"+o+"/twofactor/disable"}).then((function(){t.loading=!1,t.attrs.onDisabled(),t.hide()})).catch((function(t){}))},o}(N()),D=function(t){function o(){return t.apply(this,arguments)||this}l(o,t);var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.user=this.attrs.user,this.twoFactorEnabled=this.user.twoFactorEnabled(),this.canDisableTwoFactor=this.user.canDisable2FA(),this.backupCodesRemaining=this.user.backupCodesRemaining()||0},a.view=function(){return m("div",{className:"TwoFactorGrid"},m("ul",null,v()(this.twoFactorItems().toArray())))},a.twoFactorItems=function(){var t=new(b()),o=this.getDisableAction(),a=m(p(),{className:"Button Button--primary",onclick:this.enableTwoFactor.bind(this)},n().translator.trans("ianm-twofactor.forum.security.enable_2fa_button"));return t.add("status",m(F,{icon:"fas fa-shield-alt",title:n().translator.trans("ianm-twofactor.forum.security.two_factor_title"),value:this.twoFactorEnabled?n().translator.trans("ianm-twofactor.forum.security.two_factor_enabled"):n().translator.trans("ianm-twofactor.forum.security.two_factor_disabled"),action:this.twoFactorEnabled?o:a,helpText:!this.canDisableTwoFactor&&n().translator.trans("ianm-twofactor.forum.security.cannot_disable")})),this.twoFactorEnabled?(t.add("backupCodes",m(F,{icon:"fas fa-key",title:n().translator.trans("ianm-twofactor.forum.security.backup_codes_remaining"),value:this.backupCodesRemaining})),t):t},a.getDisableAction=function(){var t=m(p(),{className:"Button Button--danger",onclick:this.disableTwoFactor.bind(this),disabled:!this.canDisableTwoFactor},n().translator.trans("ianm-twofactor.forum.security.disable_2fa_button"));return this.canDisableTwoFactor?t:m(T(),{text:n().translator.trans("ianm-twofactor.forum.security.cannot_disable_tooltip")},t)},a.enableTwoFactor=function(){n().modal.show(C,{onEnabled:this.onTwoFactorEnabled.bind(this),user:this.user})},a.onTwoFactorEnabled=function(){this.twoFactorEnabled=!0,m.redraw()},a.disableTwoFactor=function(){n().modal.show(A,{onDisabled:this.onTwoFactorDisabled.bind(this),user:this.user})},a.onTwoFactorDisabled=function(){this.twoFactorEnabled=!1,m.redraw()},a.generateBackupCodes=function(){m.redraw()},o}(d()),M=function(t){function o(){return t.apply(this,arguments)||this}l(o,t);var a=o.prototype;return a.oninit=function(o){t.prototype.oninit.call(this,o),this.twoFactorEnabled=this.attrs.user.twoFactorEnabled(),this.canDisableTwoFactor=this.attrs.user.canDisable2FA(),this.loading=!1},a.view=function(){return m("div",null,m(D,{user:this.attrs.user}))},o}(d());const O=flarum.core.compat["common/components/FieldSet"];var S=t.n(O);const G=flarum.core.compat["common/components/LinkButton"];var R=t.n(G);const j=flarum.core.compat["forum/components/LogInModal"];var P=t.n(j);const I=flarum.core.compat["forum/ForumApplication"];var U=t.n(I);function L(){return L=Object.assign?Object.assign.bind():function(t){for(var o=1;o').insertBefore("#content")[0];m.mount(n,{view:function(){return m(r,{dismissible:!1,controls:[m(a,null)],className:"Alert--2faEnable"},t.translator.trans("ianm-twofactor.forum.user_2fa.alert_message"))}})}}(n())}))}))})(),module.exports=o})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 4887241..6393bc4 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,qDCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,c,MCExDC,GAAAA,aAAiBC,IAAI,kBAAkB,WAAO,ICF9C,MAAM,EAA+BJ,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,qC,aCAzC,SAASG,EAAgBlB,EAAGmB,GAKzC,OAJAD,EAAkBjB,OAAOmB,eAAiBnB,OA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AAKmH,eAAc,GACnB3H,EAAE2B,SAGF3B,EAAE+H,MAAMC,EAAgB,KAC1B,EAACJ,CAAA,CAnBkB,CAAS1H,KAsBxB+H,EAAc,SAAAC,GAAA,SAAAD,IAAA,OAAAC,EAAA7I,MAAA,KAAAC,YAAA,KAIjB,OAJiBR,EAAAmJ,EAAAC,GAAAD,EAAAnK,UAClByB,KAAA,SAAKgB,GACH,IAAM4H,EAAID,EAAApK,UAASyB,KAAIvB,KAAC,KAAAuC,GACxB,OAAA+E,EAAA,GAAY6C,EAAM,CAAAC,SAAU,CAACpI,EAAA,OAAKC,UAAU,aAAakI,EAAKC,YAChE,EAACH,CAAA,CAJiB,CAASI,KAOvBL,EAAiBM,EAAE,kCAAkCC,aAAa,YAAY,GAEpFvI,EAAE+H,MAAMC,EAAgB,CACtBzI,KAAM,kBACJS,EAACiI,EAAc,CAACO,aAAa,EAAOC,SAAU,CAACzI,EAAC4H,EAAe,OAAM3H,UAAU,oBAC5E1B,EAAIsJ,WAAW7G,MAAM,+CACP,GArCqB,CAwC5C,CD/CI0H,CAA6BnK,IAC/B,GHGF,G","sources":["webpack://@ianm/twofactor/webpack/bootstrap","webpack://@ianm/twofactor/webpack/runtime/compat get default export","webpack://@ianm/twofactor/webpack/runtime/define property getters","webpack://@ianm/twofactor/webpack/runtime/hasOwnProperty shorthand","webpack://@ianm/twofactor/webpack/runtime/make namespace object","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/app']\"","webpack://@ianm/twofactor/./src/common/index.ts","webpack://@ianm/twofactor/external root \"flarum.core.compat['forum/app']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/extend']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['forum/components/UserSecurityPage']\"","webpack://@ianm/twofactor/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@ianm/twofactor/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/Component']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/Button']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@ianm/twofactor/./src/forum/components/TwoFactorGridItem.js","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@ianm/twofactor/./src/forum/components/TwoFactorEnableModal.js","webpack://@ianm/twofactor/./src/forum/components/TwoFactorDisableConfirmModal .js","webpack://@ianm/twofactor/./src/forum/components/TwoFactorGrid.js","webpack://@ianm/twofactor/./src/forum/components/TwoFactorSettings.js","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/FieldSet']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['forum/ForumApplication']\"","webpack://@ianm/twofactor/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/extenders']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/models/Group']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/models/User']\"","webpack://@ianm/twofactor/./src/common/extend.ts","webpack://@ianm/twofactor/./src/forum/extend.ts","webpack://@ianm/twofactor/./src/forum/index.ts","webpack://@ianm/twofactor/./src/forum/extendUserSecurityPage.js","webpack://@ianm/twofactor/./src/forum/extendLogInModal.js","webpack://@ianm/twofactor/./src/forum/extendForumApplication.js","webpack://@ianm/twofactor/./src/forum/alertTwoFactorAuthentication.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","import app from 'flarum/common/app';\n\napp.initializers.add('ianm/twofactor', () => {});\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserSecurityPage'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\n\nexport default class TwoFactorGridItem extends Component {\n view() {\n const { icon: iconName, title, value, action, helpText } = this.attrs;\n\n return (\n
  • \n {icon(iconName)}\n
    \n {title}\n {value}\n {helpText && {helpText}}\n
    \n {action && {action}}\n
  • \n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nexport default class TwoFactorEnableModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.user = this.attrs.user;\n // Statuses: 'loading', 'displayQR', 'displayBackupCodes', 'final'\n this.status = 'loading';\n this.qrCodeUrl = null;\n this.backupCodes = [];\n this.token = Stream('');\n this.code = null;\n this.activeTab = 'qrcode';\n }\n\n className() {\n return 'TwoFactorEnableModal Modal--small';\n }\n\n title() {\n return app.translator.trans('ianm-twofactor.forum.security.two_factor_heading');\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const userId = this.user.id();\n app\n .request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + `/users/${userId}/twofactor/qrcode`,\n })\n .then((response) => {\n this.qrCodeUrl = response.svg;\n this.code = response.code;\n this.status = 'displayQR';\n m.redraw();\n });\n }\n\n onupdate() {\n const tokenInput = document.querySelector('.TwoFactorEnableModal [name=token]');\n if (tokenInput && document.activeElement !== tokenInput) {\n tokenInput.focus();\n }\n }\n\n content() {\n return (\n
    \n {this.status === 'loading' && (\n
    \n \n

    {app.translator.trans('ianm-twofactor.forum.security.loading_qr')}

    \n
    \n )}\n\n {this.status === 'displayQR' && (\n
    \n
    \n {\n this.activeTab = 'qrcode';\n m.redraw();\n }}\n >\n {app.translator.trans('ianm-twofactor.forum.security.qr_tab')}\n \n {\n this.activeTab = 'manual';\n m.redraw();\n }}\n >\n {app.translator.trans('ianm-twofactor.forum.security.manual_tab')}\n \n
    \n\n {this.activeTab === 'qrcode' && (\n
    \n {app.translator.trans('ianm-twofactor.forum.security.qr_code_alt')}\n

    {app.translator.trans('ianm-twofactor.forum.security.scan_qr_instruction')}

    \n
    \n )}\n\n {this.activeTab === 'manual' && (\n
    \n {this.code}\n

    {app.translator.trans('ianm-twofactor.forum.security.manual_entry_instruction')}

    \n
    \n )}\n\n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n )}\n\n {this.status === 'displayBackupCodes' && (\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.backup_codes')}

    \n
      \n {this.backupCodes.map((code) => (\n
    • \n {code}\n
    • \n ))}\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.backup_codes_instruction')}

    \n {\n this.status = 'final';\n m.redraw();\n }}\n >\n {app.translator.trans('ianm-twofactor.forum.security.saved_backup_codes_button')}\n \n
    \n )}\n\n {this.status === 'final' && (\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.two_factor_enabled_confirmation')}

    \n \n
    \n )}\n
    \n );\n }\n\n verifyToken() {\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/users/twofactor/verify',\n body: {\n token: this.token(),\n },\n })\n .then((response) => {\n this.backupCodes = response.backupCodes;\n this.status = 'displayBackupCodes';\n this.user.twoFactorEnabled(true);\n m.redraw();\n })\n .catch((error) => {\n //alert('Verification failed. Please try again.');\n //error.alert.content = 'Verification failed. Please try again.';\n });\n }\n\n finish() {\n this.attrs.onEnabled();\n this.hide();\n }\n\n onSubmit(e) {\n e.preventDefault();\n this.verifyToken();\n }\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\n\nexport default class TwoFactorDisableConfirmModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = false;\n }\n\n className() {\n return 'TwoFactorDisableConfirmModal Modal--small';\n }\n\n title() {\n return app.translator.trans('ianm-twofactor.forum.security.confirm_disable_2fa_title');\n }\n\n content() {\n return (\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.confirm_disable_2fa_text')}

    \n
    \n \n \n
    \n
    \n );\n }\n\n disable() {\n this.loading = true;\n const userId = this.attrs.user.id();\n\n app\n .request({\n method: 'DELETE',\n url: app.forum.attribute('apiUrl') + `/users/${userId}/twofactor/disable`,\n })\n .then(() => {\n this.loading = false;\n this.attrs.onDisabled();\n this.hide();\n })\n .catch((error) => {\n // Handle any errors.\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport TwoFactorGridItem from './TwoFactorGridItem';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport TwoFactorEnableModal from './TwoFactorEnableModal';\nimport TwoFactorDisableConfirmModal from './TwoFactorDisableConfirmModal ';\n\nexport default class TwoFactorGrid extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.user = this.attrs.user;\n this.twoFactorEnabled = this.user.twoFactorEnabled();\n this.canDisableTwoFactor = this.user.canDisable2FA();\n this.backupCodesRemaining = this.user.backupCodesRemaining() || 0;\n }\n\n view() {\n return (\n
    \n
      {listItems(this.twoFactorItems().toArray())}
    \n
    \n );\n }\n\n twoFactorItems() {\n const items = new ItemList();\n\n const disableAction = this.getDisableAction();\n const enableAction = (\n \n );\n\n items.add(\n 'status',\n \n );\n\n // Only continue to add other items if Two Factor Authentication is enabled\n if (!this.twoFactorEnabled) return items;\n\n items.add(\n 'backupCodes',\n \n // {app.translator.trans('ianm-twofactor.forum.security.generate_backup_codes_button')}\n // \n // ) : null\n // }\n />\n );\n\n // Add other items as needed\n\n return items;\n }\n\n getDisableAction() {\n const disableButton = (\n \n );\n\n return !this.canDisableTwoFactor ? (\n {disableButton}\n ) : (\n disableButton\n );\n }\n\n enableTwoFactor() {\n app.modal.show(TwoFactorEnableModal, { onEnabled: this.onTwoFactorEnabled.bind(this), user: this.user });\n }\n\n onTwoFactorEnabled() {\n this.twoFactorEnabled = true;\n m.redraw();\n }\n\n disableTwoFactor() {\n app.modal.show(TwoFactorDisableConfirmModal, { onDisabled: this.onTwoFactorDisabled.bind(this), user: this.user });\n }\n\n onTwoFactorDisabled() {\n this.twoFactorEnabled = false;\n m.redraw();\n }\n\n generateBackupCodes() {\n // Logic to generate more backup codes\n // Update this.backupCodesRemaining accordingly\n m.redraw();\n }\n}\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport TwoFactorGrid from './TwoFactorGrid';\n\nexport default class TwoFactorSettings extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.twoFactorEnabled = this.attrs.user.twoFactorEnabled();\n this.canDisableTwoFactor = this.attrs.user.canDisable2FA();\n this.loading = false;\n }\n\n view() {\n return (\n
    \n \n
    \n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/FieldSet'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/ForumApplication'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","import Extend from 'flarum/common/extenders';\nimport Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\n\nexport default [\n new Extend.Model(User) //\n .attribute('twoFactorEnabled')\n .attribute('canDisable2FA')\n .attribute('mustEnable2FA')\n .attribute('backupCodesRemaining'),\n\n new Extend.Model(Group) //\n .attribute('requires2FA'),\n];\n","import commonExtend from '../common/extend';\n\nexport default [...commonExtend];\n","import app from 'flarum/forum/app';\nimport extendUserSecurityPage from './extendUserSecurityPage';\nimport extendLogInModal from './extendLogInModal';\nimport extendForumApplication from './extendForumApplication';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('ianm/twofactor', () => {\n extendUserSecurityPage();\n extendLogInModal();\n extendForumApplication();\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport UserSecurityPage from 'flarum/forum/components/UserSecurityPage';\nimport TwoFactorSettings from './components/TwoFactorSettings';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function extendUserSecurityPage() {\n extend(UserSecurityPage.prototype, 'settingsItems', function (items) {\n items.add(\n 'twoFactor',\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.two_factor_help')}

    \n

    \n {app.translator.trans('ianm-twofactor.forum.security.two_factor_apps', {\n google: (\n \n Google Authenticator\n \n ),\n microsoft: (\n \n Microsoft Authenticator\n \n ),\n authy: (\n \n Authy\n \n ),\n })}\n

    \n \n
    ,\n 100\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default function extendLogInModal() {\n extend(LogInModal.prototype, 'oninit', function (vnode) {\n // Initialize the 2FA token stream\n this.twoFactorToken = Stream('');\n this.twoFactorRequired = false;\n });\n\n extend(LogInModal.prototype, 'fields', function (items) {\n // Add the 2FA input field to the form\n if (this.twoFactorRequired) {\n items.add(\n 'twoFactor',\n
    \n \n
    ,\n 19\n );\n\n items.remove('identification');\n items.remove('password');\n items.remove('remember');\n }\n });\n\n extend(LogInModal.prototype, 'loginParams', function (data) {\n // Add the twoFactorToken to the login params\n data.twoFactorToken = this.twoFactorToken();\n\n return data;\n });\n\n override(LogInModal.prototype, 'onerror', function (original, error) {\n if (error.status === 401) {\n const errors = error.response && error.response.errors;\n const firstErrorDetail = (errors && errors[0] && errors[0].detail) || '';\n\n if (firstErrorDetail.includes('two_factor_required')) {\n // If the error indicates that 2FA is required, show the 2FA input field\n this.twoFactorRequired = true;\n error.alert.content = app.translator.trans('ianm-twofactor.forum.log_in.two_factor_required_message');\n this.alertAttrs = error.alert;\n } else {\n // Handle other types of 401 errors here\n error.alert.content = app.translator.trans('core.forum.log_in.invalid_login_message');\n this.alertAttrs = error.alert;\n }\n m.redraw();\n this.onready();\n } else {\n original(error);\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport ForumApplication from 'flarum/forum/ForumApplication';\nimport alertTwoFactorAuthentication from './alertTwoFactorAuthentication';\n\nexport default function extendForumApplication() {\n extend(ForumApplication.prototype, 'mount', function () {\n alertTwoFactorAuthentication(app);\n });\n}\n","import Alert from 'flarum/common/components/Alert';\nimport Button from 'flarum/common/components/Button';\nimport icon from 'flarum/common/helpers/icon';\nimport Component from 'flarum/common/Component';\nimport TwoFactorEnableModal from './components/TwoFactorEnableModal';\n\n/**\n * Shows an alert if the user has not enabled 2FA.\n *\n * @param {import('../ForumApplication').default} app\n */\nexport default function alertTwoFactorAuthentication(app) {\n const user = app.session.user;\n\n if (!user || !user.mustEnable2FA()) return;\n\n class Enable2FAButton extends Component {\n view() {\n return (\n \n );\n }\n\n onclick() {\n app.modal.show(TwoFactorEnableModal, { onEnabled: this.onTwoFactorEnabled.bind(this), user });\n }\n\n onTwoFactorEnabled() {\n user.mustEnable2FA(false);\n m.redraw();\n\n // Unmount the ContainedAlert\n m.mount(alertContainer, null);\n }\n }\n\n class ContainedAlert extends Alert {\n view(vnode) {\n const vdom = super.view(vnode);\n return { ...vdom, children: [
    {vdom.children}
    ] };\n }\n }\n\n const alertContainer = $('
    ').insertBefore('#content')[0];\n\n m.mount(alertContainer, {\n view: () => (\n ]} className=\"Alert--2faEnable\">\n {app.translator.trans('ianm-twofactor.forum.user_2fa.alert_message')}\n \n ),\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","add","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","TwoFactorGridItem","_Component","apply","arguments","view","_this$attrs","this","attrs","iconName","icon","title","action","helpText","m","className","Component","TwoFactorEnableModal","_Modal","_proto","oninit","vnode","user","status","qrCodeUrl","backupCodes","token","Stream","code","activeTab","trans","oncreate","_this","userId","id","method","url","attribute","then","response","svg","redraw","onupdate","tokenInput","document","querySelector","activeElement","focus","content","_this2","LoadingIndicator","Button","onclick","src","alt","onsubmit","onSubmit","name","bidi","placeholder","type","verifyToken","map","finish","_this3","body","twoFactorEnabled","error","onEnabled","hide","e","preventDefault","Modal","TwoFactorDisableConfirmModal","loading","disable","onDisabled","TwoFactorGrid","canDisableTwoFactor","canDisable2FA","backupCodesRemaining","listItems","twoFactorItems","toArray","items","ItemList","disableAction","getDisableAction","enableAction","enableTwoFactor","disableButton","disableTwoFactor","disabled","Tooltip","text","show","onTwoFactorEnabled","onTwoFactorDisabled","generateBackupCodes","TwoFactorSettings","_extends","assign","target","i","length","source","Extend","User","Group","concat","commonExtend","extend","UserSecurityPage","FieldSet","label","google","LinkButton","external","href","rel","microsoft","authy","LogInModal","twoFactorToken","twoFactorRequired","remove","data","override","original","errors","detail","includes","alert","alertAttrs","onready","ForumApplication","session","mustEnable2FA","Enable2FAButton","translator","modal","mount","alertContainer","ContainedAlert","_Alert","vdom","children","Alert","$","insertBefore","dismissible","controls","alertTwoFactorAuthentication"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,qDCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,c,MCExDC,GAAAA,aAAiBC,IAAI,kBAAkB,WAAO,ICF9C,MAAM,EAA+BJ,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,qC,aCAzC,SAASG,EAAgBlB,EAAGmB,GAKzC,OAJAD,EAAkBjB,OAAOm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AA,KAAAR,EAAAkJ,EAAA5I,GAAA,IAAAiB,EAAA2H,EAAAlK,UAmBlB,OAnBkBuC,EACnBd,KAAA,WACE,OACES,EAACqC,IAAM,CAACpC,UAAU,sBAAsBqC,QAAS7C,KAAK6C,QAAQ1D,KAAKa,MAAOG,KAAK,qBAC5ErB,EAAI0J,WAAWjH,MAAM,mDAG5B,EAACX,EAEDiC,QAAA,WACE/D,EAAI2J,MAAMjD,KAAK9E,EAAsB,CAAEmD,UAAW7D,KAAKyF,mBAAmBtG,KAAKa,MAAOe,KAAAA,GACxF,EAACH,EAED6E,mBAAA,WACE1E,EAAKuH,eAAc,GACnB/H,EAAE2B,SAGF3B,EAAEmI,MAAMC,EAAgB,KAC1B,EAACJ,CAAA,CAnBkB,CAAS9H,KAsBxBmI,EAAc,SAAAC,GAAA,SAAAD,IAAA,OAAAC,EAAAjJ,MAAA,KAAAC,YAAA,KAIjB,OAJiBR,EAAAuJ,EAAAC,GAAAD,EAAAvK,UAClByB,KAAA,SAAKgB,GACH,IAAMgI,EAAID,EAAAxK,UAASyB,KAAIvB,KAAC,KAAAuC,GACxB,OAAA+E,EAAA,GAAYiD,EAAM,CAAAC,SAAU,CAACxI,EAAA,OAAKC,UAAU,aAAasI,EAAKC,YAChE,EAACH,CAAA,CAJiB,CAASI,KAOvBL,EAAiBM,EAAE,kCAAkCC,aAAa,YAAY,GAEpF3I,EAAEmI,MAAMC,EAAgB,CACtB7I,KAAM,kBACJS,EAACqI,EAAc,CAACO,aAAa,EAAOC,SAAU,CAAC7I,EAACgI,EAAe,OAAM/H,UAAU,oBAC5E1B,EAAI0J,WAAWjH,MAAM,+CACP,GArCqB,CAwC5C,CD/CI8H,CAA6BvK,IAC/B,GHGF,G","sources":["webpack://@ianm/twofactor/webpack/bootstrap","webpack://@ianm/twofactor/webpack/runtime/compat get default export","webpack://@ianm/twofactor/webpack/runtime/define property getters","webpack://@ianm/twofactor/webpack/runtime/hasOwnProperty shorthand","webpack://@ianm/twofactor/webpack/runtime/make namespace object","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/app']\"","webpack://@ianm/twofactor/./src/common/index.ts","webpack://@ianm/twofactor/external root \"flarum.core.compat['forum/app']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/extend']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['forum/components/UserSecurityPage']\"","webpack://@ianm/twofactor/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@ianm/twofactor/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/Component']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/Button']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@ianm/twofactor/./src/forum/components/TwoFactorGridItem.js","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@ianm/twofactor/./src/forum/components/TwoFactorEnableModal.js","webpack://@ianm/twofactor/./src/forum/components/TwoFactorDisableConfirmModal .js","webpack://@ianm/twofactor/./src/forum/components/TwoFactorGrid.js","webpack://@ianm/twofactor/./src/forum/components/TwoFactorSettings.js","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/FieldSet']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['forum/ForumApplication']\"","webpack://@ianm/twofactor/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/extenders']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/models/Group']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/models/User']\"","webpack://@ianm/twofactor/./src/common/extend.ts","webpack://@ianm/twofactor/./src/forum/extend.ts","webpack://@ianm/twofactor/./src/forum/index.ts","webpack://@ianm/twofactor/./src/forum/extendUserSecurityPage.js","webpack://@ianm/twofactor/./src/forum/extendLogInModal.js","webpack://@ianm/twofactor/./src/forum/extendForumApplication.js","webpack://@ianm/twofactor/./src/forum/alertTwoFactorAuthentication.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","import app from 'flarum/common/app';\n\napp.initializers.add('ianm/twofactor', () => {});\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserSecurityPage'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\n\nexport default class TwoFactorGridItem extends Component {\n view() {\n const { icon: iconName, title, value, action, helpText } = this.attrs;\n\n return (\n
  • \n {icon(iconName)}\n
    \n {title}\n {value}\n {helpText && {helpText}}\n
    \n {action && {action}}\n
  • \n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\n\nexport default class TwoFactorEnableModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.user = this.attrs.user;\n // Statuses: 'loading', 'displayQR', 'displayBackupCodes', 'final'\n this.status = 'loading';\n this.qrCodeUrl = null;\n this.backupCodes = [];\n this.token = Stream('');\n this.code = null;\n this.activeTab = 'qrcode';\n }\n\n className() {\n return 'TwoFactorEnableModal Modal--small';\n }\n\n title() {\n return app.translator.trans('ianm-twofactor.forum.security.two_factor_heading');\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const userId = this.user.id();\n app\n .request({\n method: 'GET',\n url: app.forum.attribute('apiUrl') + `/users/${userId}/twofactor/qrcode`,\n })\n .then((response) => {\n this.qrCodeUrl = response.svg;\n this.code = response.code;\n this.status = 'displayQR';\n m.redraw();\n });\n }\n\n onupdate() {\n const tokenInput = document.querySelector('.TwoFactorEnableModal [name=token]');\n if (tokenInput && document.activeElement !== tokenInput) {\n tokenInput.focus();\n }\n }\n\n content() {\n return (\n
    \n {this.status === 'loading' && (\n
    \n \n

    {app.translator.trans('ianm-twofactor.forum.security.loading_qr')}

    \n
    \n )}\n\n {this.status === 'displayQR' && (\n
    \n
    \n {\n this.activeTab = 'qrcode';\n m.redraw();\n }}\n >\n {app.translator.trans('ianm-twofactor.forum.security.qr_tab')}\n \n {\n this.activeTab = 'manual';\n m.redraw();\n }}\n >\n {app.translator.trans('ianm-twofactor.forum.security.manual_tab')}\n \n
    \n\n {this.activeTab === 'qrcode' && (\n
    \n {app.translator.trans('ianm-twofactor.forum.security.qr_code_alt')}\n

    {app.translator.trans('ianm-twofactor.forum.security.scan_qr_instruction')}

    \n
    \n )}\n\n {this.activeTab === 'manual' && (\n
    \n {this.code}\n

    {app.translator.trans('ianm-twofactor.forum.security.manual_entry_instruction')}

    \n
    \n )}\n\n
    \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n
    \n
    \n )}\n\n {this.status === 'displayBackupCodes' && (\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.backup_codes')}

    \n
      \n {this.backupCodes.map((code) => (\n
    • \n {code}\n
    • \n ))}\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.backup_codes_instruction')}

    \n {\n this.status = 'final';\n m.redraw();\n }}\n >\n {app.translator.trans('ianm-twofactor.forum.security.saved_backup_codes_button')}\n \n
    \n )}\n\n {this.status === 'final' && (\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.two_factor_enabled_confirmation')}

    \n \n
    \n )}\n
    \n );\n }\n\n verifyToken() {\n app\n .request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/users/twofactor/verify',\n body: {\n token: this.token(),\n },\n })\n .then((response) => {\n this.backupCodes = response.backupCodes;\n this.status = 'displayBackupCodes';\n this.user.twoFactorEnabled(true);\n m.redraw();\n })\n .catch((error) => {\n //alert('Verification failed. Please try again.');\n //error.alert.content = 'Verification failed. Please try again.';\n });\n }\n\n finish() {\n this.attrs.onEnabled();\n this.hide();\n }\n\n onSubmit(e) {\n e.preventDefault();\n this.verifyToken();\n }\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\n\nexport default class TwoFactorDisableConfirmModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.loading = false;\n }\n\n className() {\n return 'TwoFactorDisableConfirmModal Modal--small';\n }\n\n title() {\n return app.translator.trans('ianm-twofactor.forum.security.confirm_disable_2fa_title');\n }\n\n content() {\n return (\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.confirm_disable_2fa_text')}

    \n
    \n \n \n
    \n
    \n );\n }\n\n disable() {\n this.loading = true;\n const userId = this.attrs.user.id();\n\n app\n .request({\n method: 'DELETE',\n url: app.forum.attribute('apiUrl') + `/users/${userId}/twofactor/disable`,\n })\n .then(() => {\n this.loading = false;\n this.attrs.onDisabled();\n this.hide();\n })\n .catch((error) => {\n // Handle any errors.\n });\n }\n}\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport TwoFactorGridItem from './TwoFactorGridItem';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport TwoFactorEnableModal from './TwoFactorEnableModal';\nimport TwoFactorDisableConfirmModal from './TwoFactorDisableConfirmModal ';\n\nexport default class TwoFactorGrid extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.user = this.attrs.user;\n this.twoFactorEnabled = this.user.twoFactorEnabled();\n this.canDisableTwoFactor = this.user.canDisable2FA();\n this.backupCodesRemaining = this.user.backupCodesRemaining() || 0;\n }\n\n view() {\n return (\n
    \n
      {listItems(this.twoFactorItems().toArray())}
    \n
    \n );\n }\n\n twoFactorItems() {\n const items = new ItemList();\n\n const disableAction = this.getDisableAction();\n const enableAction = (\n \n );\n\n items.add(\n 'status',\n \n );\n\n // Only continue to add other items if Two Factor Authentication is enabled\n if (!this.twoFactorEnabled) return items;\n\n items.add(\n 'backupCodes',\n \n // {app.translator.trans('ianm-twofactor.forum.security.generate_backup_codes_button')}\n // \n // ) : null\n // }\n />\n );\n\n // Add other items as needed\n\n return items;\n }\n\n getDisableAction() {\n const disableButton = (\n \n );\n\n return !this.canDisableTwoFactor ? (\n {disableButton}\n ) : (\n disableButton\n );\n }\n\n enableTwoFactor() {\n app.modal.show(TwoFactorEnableModal, { onEnabled: this.onTwoFactorEnabled.bind(this), user: this.user });\n }\n\n onTwoFactorEnabled() {\n this.twoFactorEnabled = true;\n m.redraw();\n }\n\n disableTwoFactor() {\n app.modal.show(TwoFactorDisableConfirmModal, { onDisabled: this.onTwoFactorDisabled.bind(this), user: this.user });\n }\n\n onTwoFactorDisabled() {\n this.twoFactorEnabled = false;\n m.redraw();\n }\n\n generateBackupCodes() {\n // Logic to generate more backup codes\n // Update this.backupCodesRemaining accordingly\n m.redraw();\n }\n}\n","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport TwoFactorGrid from './TwoFactorGrid';\n\nexport default class TwoFactorSettings extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.twoFactorEnabled = this.attrs.user.twoFactorEnabled();\n this.canDisableTwoFactor = this.attrs.user.canDisable2FA();\n this.loading = false;\n }\n\n view() {\n return (\n
    \n \n
    \n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/FieldSet'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/ForumApplication'];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","import Extend from 'flarum/common/extenders';\nimport Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\n\nexport default [\n new Extend.Model(User) //\n .attribute('twoFactorEnabled')\n .attribute('canDisable2FA')\n .attribute('mustEnable2FA')\n .attribute('backupCodesRemaining'),\n\n new Extend.Model(Group) //\n .attribute('requires2FA'),\n];\n","import commonExtend from '../common/extend';\n\nexport default [...commonExtend];\n","import app from 'flarum/forum/app';\nimport extendUserSecurityPage from './extendUserSecurityPage';\nimport extendLogInModal from './extendLogInModal';\nimport extendForumApplication from './extendForumApplication';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('ianm/twofactor', () => {\n extendUserSecurityPage();\n extendLogInModal();\n extendForumApplication();\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport UserSecurityPage from 'flarum/forum/components/UserSecurityPage';\nimport TwoFactorSettings from './components/TwoFactorSettings';\nimport FieldSet from 'flarum/common/components/FieldSet';\nimport LinkButton from 'flarum/common/components/LinkButton';\n\nexport default function extendUserSecurityPage() {\n extend(UserSecurityPage.prototype, 'settingsItems', function (items) {\n items.add(\n 'twoFactor',\n
    \n

    {app.translator.trans('ianm-twofactor.forum.security.two_factor_help')}

    \n

    \n {app.translator.trans('ianm-twofactor.forum.security.two_factor_apps', {\n google: (\n \n Google Authenticator\n \n ),\n microsoft: (\n \n Microsoft Authenticator\n \n ),\n authy: (\n \n Authy\n \n ),\n })}\n

    \n \n
    ,\n 100\n );\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport Stream from 'flarum/common/utils/Stream';\n\nexport default function extendLogInModal() {\n extend(LogInModal.prototype, 'oninit', function (vnode) {\n // Initialize the 2FA token stream\n this.twoFactorToken = Stream('');\n this.twoFactorRequired = false;\n });\n\n extend(LogInModal.prototype, 'fields', function (items) {\n // Add the 2FA input field to the form\n if (this.twoFactorRequired) {\n items.add(\n 'twoFactor',\n
    \n {app.translator.trans('ianm-twofactor.forum.log_in.two_factor_required_message')}\n {\n this.twoFactorToken(e.currentTarget.value);\n\n if (e.target.value.length === 6) {\n this.onsubmit(new Event('submit')); // Trigger the onsubmit method\n }\n }}\n />\n
    ,\n 19\n );\n\n items.remove('identification');\n items.remove('password');\n items.remove('remember');\n }\n });\n\n extend(LogInModal.prototype, 'loginParams', function (data) {\n // Add the twoFactorToken to the login params\n data.twoFactorToken = this.twoFactorToken();\n\n return data;\n });\n\n override(LogInModal.prototype, 'body', function (original) {\n if (this.twoFactorRequired) {\n return
    {this.fields().toArray()}
    ;\n }\n\n return original();\n });\n\n override(LogInModal.prototype, 'footer', function (original) {\n if (this.twoFactorRequired) {\n return null;\n }\n\n return original();\n });\n\n override(LogInModal.prototype, 'onerror', function (original, error) {\n if (error.status === 422) {\n const errors = error.response && error.response.errors;\n const firstErrorDetail = (errors && errors[0] && errors[0].detail) || '';\n\n if (firstErrorDetail.includes('two_factor_required')) {\n // If the error indicates that 2FA is required, show the 2FA input field\n this.twoFactorRequired = true;\n } else {\n // Handle other types of 422 errors here\n error.alert.content = app.translator.trans('core.forum.log_in.invalid_login_message');\n this.alertAttrs = error.alert;\n }\n m.redraw();\n this.onready();\n } else {\n original(error);\n }\n });\n}\n","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport ForumApplication from 'flarum/forum/ForumApplication';\nimport alertTwoFactorAuthentication from './alertTwoFactorAuthentication';\n\nexport default function extendForumApplication() {\n extend(ForumApplication.prototype, 'mount', function () {\n alertTwoFactorAuthentication(app);\n });\n}\n","import Alert from 'flarum/common/components/Alert';\nimport Button from 'flarum/common/components/Button';\nimport icon from 'flarum/common/helpers/icon';\nimport Component from 'flarum/common/Component';\nimport TwoFactorEnableModal from './components/TwoFactorEnableModal';\n\n/**\n * Shows an alert if the user has not enabled 2FA.\n *\n * @param {import('../ForumApplication').default} app\n */\nexport default function alertTwoFactorAuthentication(app) {\n const user = app.session.user;\n\n if (!user || !user.mustEnable2FA()) return;\n\n class Enable2FAButton extends Component {\n view() {\n return (\n \n );\n }\n\n onclick() {\n app.modal.show(TwoFactorEnableModal, { onEnabled: this.onTwoFactorEnabled.bind(this), user });\n }\n\n onTwoFactorEnabled() {\n user.mustEnable2FA(false);\n m.redraw();\n\n // Unmount the ContainedAlert\n m.mount(alertContainer, null);\n }\n }\n\n class ContainedAlert extends Alert {\n view(vnode) {\n const vdom = super.view(vnode);\n return { ...vdom, children: [
    {vdom.children}
    ] };\n }\n }\n\n const alertContainer = $('
    ').insertBefore('#content')[0];\n\n m.mount(alertContainer, {\n view: () => (\n ]} className=\"Alert--2faEnable\">\n {app.translator.trans('ianm-twofactor.forum.user_2fa.alert_message')}\n \n ),\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","add","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","TwoFactorGridItem","_Component","apply","arguments","view","_this$attrs","this","attrs","iconName","icon","title","action","helpText","m","className","Component","TwoFactorEnableModal","_Modal","_proto","oninit","vnode","user","status","qrCodeUrl","backupCodes","token","Stream","code","activeTab","trans","oncreate","_this","userId","id","method","url","attribute","then","response","svg","redraw","onupdate","tokenInput","document","querySelector","activeElement","focus","content","_this2","LoadingIndicator","Button","onclick","src","alt","onsubmit","onSubmit","name","bidi","placeholder","type","verifyToken","map","finish","_this3","body","twoFactorEnabled","error","onEnabled","hide","e","preventDefault","Modal","TwoFactorDisableConfirmModal","loading","disable","onDisabled","TwoFactorGrid","canDisableTwoFactor","canDisable2FA","backupCodesRemaining","listItems","twoFactorItems","toArray","items","ItemList","disableAction","getDisableAction","enableAction","enableTwoFactor","disableButton","disableTwoFactor","disabled","Tooltip","text","show","onTwoFactorEnabled","onTwoFactorDisabled","generateBackupCodes","TwoFactorSettings","_extends","assign","target","i","length","source","Extend","User","Group","concat","commonExtend","extend","UserSecurityPage","FieldSet","label","google","LinkButton","external","href","rel","microsoft","authy","LogInModal","twoFactorToken","twoFactorRequired","oninput","currentTarget","Event","remove","data","override","original","fields","errors","detail","includes","alert","alertAttrs","onready","ForumApplication","session","mustEnable2FA","Enable2FAButton","translator","modal","mount","alertContainer","ContainedAlert","_Alert","vdom","children","Alert","$","insertBefore","dismissible","controls","alertTwoFactorAuthentication"],"sourceRoot":""} \ No newline at end of file