قرینه از
https://github.com/matomo-org/matomo.git
synced 2025-08-22 15:07:44 +00:00

* PG-4133 Improve login screen UI - Moved form from twig to vue to enable auto-disable of submit. - Auto disable submit. - Much nicer design (Thanks Shelby!). * Updated tests for login form, PG-4133 * Build vue files * Removed invalid spec.ts file, PG-4133 * UI test updates, PG-4133 * UI test screenshots updated - PG-4133 * Replaced commented out code, PG-4133 * Remove vue component and use plain js, PG-4133 * Removed comment, PG-4133 * Self-review fixes - PG-4133 * Update screenshots + css tweak PG-4133 * Build vue files * Adds new whats new section entry for CustomReports, #PG-2528 (#23270) * UI test update, PG-4133 * Moved test to be local to correct plugin, PG-4133 * Fix UI test result filename, PG-4133 * Reset password button now matches login button, PG-4133 * Updated to use disabled attribute, not css class Also set the default to be disabled. * Fixed spacing * Changed screenshot to functional test, PG-4133 * Reverted text changes - moved to separate ticket, PG-4133 * Updated test screenshots, PG-4133 * Removed unnecessary UI screenshot file, PG-4133 * Updated UI test screenshots, PG-4133 * 2FA button stretched to match login buttons. * Minor less refactor, no functional change, PG-4133 * Limit width of login screens to 750px max * Darken disabled buttons, bold buttons on login. PG-4133 * Move button darkening into just the Login area for this PR * Updated UI tests, PG-4133 * Aligned login submit buttons with inputs above, PG-4133 * updates expected UI test files * update submodule --------- Co-authored-by: James Hill <james-hill-matomo@users.noreply.github.com> Co-authored-by: innocraft-automation <innocraft-automation@users.noreply.github.com> Co-authored-by: Altamash Shaikh <altu9594@gmail.com> Co-authored-by: sgiehl <stefan@matomo.org>
14 خطوط
27 KiB
JavaScript
Generated
14 خطوط
27 KiB
JavaScript
Generated
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("Login"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome","Login",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["TwoFactorAuth"]=t(require("CoreHome"),require("Login"),require("vue"),require("CorePluginsAdmin")):e["TwoFactorAuth"]=t(e["CoreHome"],e["Login"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,o,n){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="plugins/TwoFactorAuth/vue/dist/",o(o.s="fae3")}({"19dc":function(t,o){t.exports=e},"5b81":function(e,o){e.exports=t},"8bbf":function(e,t){e.exports=o},a5a2:function(e,t){e.exports=n},fae3:function(e,t,o){"use strict";if(o.r(t),o.d(t,"ShowRecoveryCodes",(function(){return f})),o.d(t,"ShowRecoveryCodesPage",(function(){return S})),o.d(t,"SetupTwoFactorAuth",(function(){return de})),o.d(t,"LoginTwoFactorAuth",(function(){return Me})),o.d(t,"SetupFinished",(function(){return Ge})),o.d(t,"UserSettings",(function(){return dt})),"undefined"!==typeof window){var n=window.document.currentScript,r=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(o.p=r[1])}var a=o("8bbf");const c=Object(a["createElementVNode"])("br",null,null,-1),l=Object(a["createElementVNode"])("br",null,null,-1),i={class:"alert alert-warning"},s={key:0,class:"twoFactorRecoveryCodes browser-default"},u={key:1,class:"alert alert-danger"},d=Object(a["createElementVNode"])("br",null,null,-1),b=["value"],p=["value"],m=["value"];function O(e,t,o,n,r,O){var j;const h=Object(a["resolveDirective"])("select-on-focus");return Object(a["openBlock"])(),Object(a["createElementBlock"])("div",null,[Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodesExplanation")),1),c,l]),Object(a["createElementVNode"])("div",i,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodesSecurity")),1),null!==(j=e.codes)&&void 0!==j&&j.length?Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("ul",s,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.codes,(e,t)=>(Object(a["openBlock"])(),Object(a["createElementBlock"])("li",{key:t},Object(a["toDisplayString"])(e.toUpperCase().match(/.{1,4}/g).join("-")),1))),128))])),[[h,{}]]):(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",u,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodesAllUsed")),1)),Object(a["createElementVNode"])("p",null,[d,Object(a["createElementVNode"])("input",{type:"button",class:"btn backupRecoveryCode",onClick:t[0]||(t[0]=t=>{e.downloadRecoveryCodes(),e.$emit("downloaded")}),value:e.translate("General_Download"),style:{"margin-right":"3.5px"}},null,8,b),Object(a["createElementVNode"])("input",{type:"button",class:"btn backupRecoveryCode",onClick:t[1]||(t[1]=t=>{e.print(),e.$emit("downloaded")}),value:e.translate("General_Print"),style:{"margin-right":"3.5px"}},null,8,p),Object(a["createElementVNode"])("input",{type:"button",class:"btn backupRecoveryCode",onClick:t[2]||(t[2]=t=>{e.copyRecoveryCodesToClipboard(),e.$emit("downloaded")}),value:e.translate("General_Copy")},null,8,m)])])}var j=o("19dc"),h=Object(a["defineComponent"])({props:{codes:{type:Array,default(){return[]}}},directives:{SelectOnFocus:j["SelectOnFocus"]},emits:["downloaded"],methods:{copyRecoveryCodesToClipboard(){const e=document.createElement("textarea");e.value=this.codes.join("\n"),e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e)},downloadRecoveryCodes(){j["Matomo"].helper.sendContentAsDownload("analytics_recovery_codes.txt",this.codes.join("\n"))},print(){window.print()}}});h.render=O;var f=h;const w=Object(a["createElementVNode"])("br",null,null,-1),y=Object(a["createElementVNode"])("br",null,null,-1),g={key:0,class:"alert alert-success"},v={key:1,class:"alert alert-danger"},C=["action"],N=["value"],E=["value"];function V(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("ShowRecoveryCodes"),i=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(i,{"content-title":e.contentTitle},{default:Object(a["withCtx"])(()=>[Object(a["createVNode"])(l,{codes:e.codes},null,8,["codes"]),Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_GenerateNewRecoveryCodes")),1),Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_GenerateNewRecoveryCodesInfo")),1),w,y]),e.regenerateSuccess?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",g,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodesRegenerated")),1)):Object(a["createCommentVNode"])("",!0),e.regenerateError?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",v,Object(a["toDisplayString"])(e.translate("General_ExceptionSecurityCheckFailed")),1)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("form",{method:"post",action:e.showRecoveryCodesLink},[Object(a["createElementVNode"])("input",{type:"hidden",name:"regenerateNonce",value:e.regenerateNonce},null,8,N),Object(a["createElementVNode"])("input",{type:"submit",class:"btn",value:e.translate("TwoFactorAuth_GenerateNewRecoveryCodes")},null,8,E)],8,C)]),_:1},8,["content-title"])}var T=Object(a["defineComponent"])({props:{codes:Array,regenerateSuccess:Boolean,regenerateError:Boolean,regenerateNonce:{type:String,required:!0}},components:{ContentBlock:j["ContentBlock"],ShowRecoveryCodes:f},computed:{contentTitle(){const e=Object(j["translate"])("TwoFactorAuth_TwoFactorAuthentication"),t=Object(j["translate"])("TwoFactorAuth_RecoveryCodes");return`${e} - ${t}`},showRecoveryCodesLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"TwoFactorAuth",action:"showRecoveryCodes"}))}}});T.render=V;var S=T;const A={class:"setupTwoFactorAuthentication",ref:"root"},F={key:0,class:"alert alert-warning"},k=["disabled"],_=Object(a["createElementVNode"])("a",{name:"twoFactorStep2",id:"twoFactorStep2",style:{opacity:"0"}},null,-1),D=["innerHTML"],B=Object(a["createElementVNode"])("br",null,null,-1),x=Object(a["createElementVNode"])("a",{name:"twoFactorStep3",id:"twoFactorStep3",style:{opacity:"0"}},null,-1),M={key:0,class:"message_container"},L=["innerHTML"],R=Object(a["createElementVNode"])("br",null,null,-1),q=["action"],U=["value"],P=["disabled","value"],G={class:"ui-confirm two-fa-qr-code-dialog"},H={class:"row"},$={class:"col l8 offset-l2 m10 offset-m1 s12 center-align"},I={id:"qrcode",ref:"qrcode",title:""},z={class:"text-code"},Q=["innerHTML"],X={class:"row"},Y={class:"col l8 offset-l2 m10 offset-m1 s12"},W=["value"],J=["value"];function K(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("ShowRecoveryCodes"),i=Object(a["resolveComponent"])("InstallOTPApp"),s=Object(a["resolveComponent"])("Notification"),u=Object(a["resolveComponent"])("Field"),d=Object(a["resolveComponent"])("MatomoDialog"),b=Object(a["resolveComponent"])("ContentBlock"),p=Object(a["resolveDirective"])("copy-to-clipboard");return Object(a["openBlock"])(),Object(a["createBlock"])(b,{"content-title":e.standalone?e.translate("TwoFactorAuth_RequiredToSetUpTwoFactorAuthentication"):e.translate("TwoFactorAuth_SetUpTwoFactorAuthentication")},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("div",A,[e.isAlreadyUsing2fa?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",F,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_WarningChangingConfiguredDevice")),1)):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupIntroFollowSteps")),1),Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_StepX",1))+" - "+Object(a["toDisplayString"])(e.translate("TwoFactorAuth_RecoveryCodes")),1),Object(a["createVNode"])(l,{codes:e.codes,onDownloaded:t[0]||(t[0]=e=>this.hasDownloadedRecoveryCode=!0)},null,8,["codes"]),Object(a["withDirectives"])(Object(a["createElementVNode"])("div",{class:"alert alert-info backupRecoveryCodesAlert"},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupBackupRecoveryCodes")),513),[[a["vShow"],1===e.step]]),Object(a["createElementVNode"])("p",null,[Object(a["withDirectives"])(Object(a["createElementVNode"])("button",{class:"btn goToStep2",onClick:t[1]||(t[1]=t=>e.nextStep()),disabled:!e.hasDownloadedRecoveryCode},Object(a["toDisplayString"])(e.translate("General_Next")),9,k),[[a["vShow"],1===e.step]])]),_,Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_StepX",2))+" - "+Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupAuthenticatorOnDevice")),1),Object(a["createVNode"])(i),Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.setupAuthenticatorOnDeviceStep2ShowCodes)},null,8,D),Object(a["createElementVNode"])("p",null,[B,Object(a["withDirectives"])(Object(a["createElementVNode"])("button",{class:"btn showOtpCodes",onClick:t[2]||(t[2]=t=>e.showQrCodeModal())},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ShowCodes")),513),[[a["vShow"],e.step>=2]])])],512),[[a["vShow"],e.step>=2]]),x,Object(a["withDirectives"])(Object(a["createElementVNode"])("div",null,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_StepX",3))+" - "+Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ConfirmSetup")),1),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_VerifyAuthCodeIntro")),1),e.accessErrorString?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",M,[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(s,{noclear:!0,context:"error"},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("General_Error")),1),Object(a["createTextVNode"])(": "),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.accessErrorString)},null,8,L),R]),_:1})])])):Object(a["createCommentVNode"])("",!0),Object(a["createElementVNode"])("form",{method:"post",class:"setupConfirmAuthCodeForm",autocorrect:"off",autocapitalize:"none",autocomplete:"off",action:e.linkTo({module:"TwoFactorAuth",action:e.submitAction})},[Object(a["createElementVNode"])("div",null,[Object(a["createVNode"])(u,{uicontrol:"text",name:"authCode",title:e.translate("TwoFactorAuth_AuthenticationCode"),modelValue:e.authCode,"onUpdate:modelValue":t[3]||(t[3]=t=>e.authCode=t),maxlength:6,placeholder:"123456",autocomplete:"one-time-code","inline-help":e.translate("TwoFactorAuth_VerifyAuthCodeHelp")},null,8,["title","modelValue","inline-help"])]),Object(a["createElementVNode"])("input",{type:"hidden",name:"authCodeNonce",value:e.authCodeNonce},null,8,U),Object(a["createElementVNode"])("input",{type:"submit",class:"btn confirmAuthCode",disabled:6!==e.authCode.length,value:e.translate("General_Confirm")},null,8,P)],8,q)],512),[[a["vShow"],e.step>=3]]),Object(a["createVNode"])(d,{modelValue:e.qrCodeDialogVisible,"onUpdate:modelValue":t[4]||(t[4]=t=>e.qrCodeDialogVisible=t),onValidation:t[5]||(t[5]=t=>{e.closeQrCodeModal(),e.nextStep()}),options:{focusSelector:".modal-action.btn"}},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("div",G,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_Your2FaAuthSecret")),1),Object(a["createElementVNode"])("div",H,[Object(a["createElementVNode"])("div",$,[Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ShowCodeModalInstructions1")),1),Object(a["createElementVNode"])("p",null,[Object(a["createElementVNode"])("span",I,null,512)]),Object(a["createElementVNode"])("p",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ShowCodeModalInstructions2")),1),Object(a["createElementVNode"])("div",z,[Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("pre",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.newSecret),1)])),[[p,{}]])]),Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.showCodeModalInstructions3)},null,8,Q)])]),Object(a["createElementVNode"])("div",X,[Object(a["createElementVNode"])("div",Y,[Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_DontHaveOTPApp")),1),Object(a["createVNode"])(i)])]),Object(a["createElementVNode"])("input",{role:"validation",type:"button",value:e.translate("General_Continue")},null,8,W),Object(a["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Cancel")},null,8,J)])]),_:1},8,["modelValue","options"])],512)]),_:1},8,["content-title"])}var Z=o("a5a2");
|
|
/*!
|
|
* Matomo - free/libre analytics platform
|
|
*
|
|
* @link https://matomo.org
|
|
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
|
*/const ee=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://github.com/andOTP/andOTP#downloads"},"andOTP",-1),te=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://authy.com/guides/github/"},"Authy",-1),oe=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://support.1password.com/one-time-passwords/"},"1Password",-1),ne=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://helpdesk.lastpass.com/multifactor-authentication-options/lastpass-authenticator/"},"LastPass Authenticator",-1),re=Object(a["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:"https://support.google.com/accounts/answer/1066447"},"Google Authenticator",-1);function ae(e,t,o,n,r,c){return Object(a["openBlock"])(),Object(a["createElementBlock"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupAuthenticatorOnDeviceStep1"))+" ",1),ee,Object(a["createTextVNode"])(", "),te,Object(a["createTextVNode"])(", "),oe,Object(a["createTextVNode"])(", "),ne,Object(a["createTextVNode"])(", "+Object(a["toDisplayString"])(e.translate("General_Or"))+" ",1),re,Object(a["createTextVNode"])(". ")])}var ce=Object(a["defineComponent"])({});ce.render=ae;var le=ce;const{QRCode:ie,$:se}=window;var ue=Object(a["defineComponent"])({props:{isAlreadyUsing2fa:Boolean,accessErrorString:String,submitAction:{type:String,required:!0},authCodeNonce:{type:String,required:!0},newSecret:{type:String,required:!0},codes:Array,twoFaBarCodeSetupUrl:{type:String,required:!0},standalone:Boolean},components:{InstallOTPApp:le,MatomoDialog:j["MatomoDialog"],ShowRecoveryCodes:f,Notification:j["Notification"],Field:Z["Field"],ContentBlock:j["ContentBlock"]},directives:{CopyToClipboard:j["CopyToClipboard"]},data(){return{step:1,hasDownloadedRecoveryCode:!1,authCode:"",qrCodeDialogVisible:!1}},mounted(){setTimeout(()=>{const e=this.$refs.qrcode;new ie(e,{text:this.twoFaBarCodeSetupUrl,width:200,height:200}),se(e).attr("title",""),this.accessErrorString&&(this.step=3,this.scrollToEnd())})},methods:{scrollToEnd(){setTimeout(()=>{let e="";2===this.step?e="#twoFactorStep2":3===this.step&&(e="#twoFactorStep3"),e&&j["Matomo"].helper.lazyScrollTo(e,50,!0)},50)},showQrCodeModal(){this.qrCodeDialogVisible=!0},closeQrCodeModal(){this.qrCodeDialogVisible=!1},nextStep(){this.step+=1,this.step>3&&(this.step=3),this.scrollToEnd()},linkTo(e){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),e))}},computed:{setupAuthenticatorOnDeviceStep2ShowCodes(){return Object(j["translate"])("TwoFactorAuth_SetupAuthenticatorOnDeviceStep2ShowCodes",Object(j["translate"])("TwoFactorAuth_ShowCodes"))},showCodeModalInstructions3(){return Object(j["translate"])("TwoFactorAuth_ShowCodeModalInstructions3",Object(j["translate"])("General_Continue"))}}});ue.render=K;var de=ue;const be={class:"message_container"},pe=["innerHTML"],me=Object(a["createElementVNode"])("br",null,null,-1),Oe={class:"row"},je={class:"col s12 input-field"},he=["value"],fe=Object(a["createElementVNode"])("input",{type:"text",name:"form_authcode",placeholder:"",id:"form_authcode",class:"input",value:"",size:"20",autocorrect:"off",autocapitalize:"none",autocomplete:"one-time-code",tabindex:"10",autofocus:"autofocus"},null,-1),we={for:"form_authcode"},ye=Object(a["createElementVNode"])("i",{class:"icon-user icon"},null,-1),ge={class:"row actions"},ve={class:"col s12"},Ce=["value"],Ne=["innerHTML"],Ee=Object(a["createElementVNode"])("br",null,null,-1),Ve=Object(a["createElementVNode"])("br",null,null,-1),Te=Object(a["createElementVNode"])("br",null,null,-1),Se=["href"],Ae=Object(a["createElementVNode"])("br",null,null,-1),Fe=["href"],ke=Object(a["createElementVNode"])("br",null,null,-1),_e=["href"];function De(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("FormErrors"),i=Object(a["resolveComponent"])("Notification"),s=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(s,{"content-title":e.translate("TwoFactorAuth_TwoFactorAuthentication")},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("div",be,[Object(a["createVNode"])(l,{"form-errors":e.formData.errors},null,8,["form-errors"]),e.accessErrorString?(Object(a["openBlock"])(),Object(a["createBlock"])(i,{key:0,noclear:!0,context:"error"},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("General_Error")),1),Object(a["createTextVNode"])(": "),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.accessErrorString)},null,8,pe),me]),_:1})):Object(a["createCommentVNode"])("",!0)]),Object(a["createElementVNode"])("form",Object(a["mergeProps"])(e.formDataAttributes,{class:"loginTwoFaForm"}),[Object(a["createElementVNode"])("div",Oe,[Object(a["createElementVNode"])("div",je,[Object(a["createElementVNode"])("input",{type:"hidden",name:"form_nonce",id:"login_form_nonce",value:e.formNonce},null,8,he),fe,Object(a["createElementVNode"])("label",we,[ye,Object(a["createTextVNode"])(" "+Object(a["toDisplayString"])(e.translate("TwoFactorAuth_AuthenticationCode")),1)])])]),Object(a["createElementVNode"])("div",ge,[Object(a["createElementVNode"])("div",ve,[Object(a["createElementVNode"])("input",{class:"submit btn btn-block",id:"login_form_submit",type:"submit",value:e.translate("TwoFactorAuth_Verify"),tabindex:"100"},null,8,Ce)])])],16),Object(a["createElementVNode"])("p",null,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_VerifyIdentifyExplanation"))+" ",1),Object(a["createElementVNode"])("span",{innerHTML:e.$sanitize(e.learnMoreText)},null,8,Ne),Ee,Ve,Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_DontHaveYourMobileDevice")),1),Te,Object(a["createElementVNode"])("a",{href:e.externalRawLink("https://matomo.org/faq/how-to/faq_27248"),rel:"noreferrer noopener",target:"_blank"},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_EnterRecoveryCodeInstead")),9,Se),Ae,Object(a["createElementVNode"])("a",{href:e.mailToLink,rel:"noreferrer noopener"},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_AskSuperUserResetAuthenticationCode")),9,Fe),ke,Object(a["createElementVNode"])("a",{href:e.logoutLink,rel:"noreferrer noopener"},Object(a["toDisplayString"])(e.translate("General_Logout")),9,_e)])]),_:1},8,["content-title"])}var Be=o("5b81"),xe=Object(a["defineComponent"])({props:{formData:{type:Object,required:!0},accessErrorString:String,formNonce:{type:String,required:!0},loginModule:{type:String,required:!0},piwikUrl:String,userLogin:{type:String,required:!0},contactEmail:{type:String,required:!0}},components:{ContentBlock:j["ContentBlock"],Notification:j["Notification"],FormErrors:Be["FormErrors"]},computed:{learnMoreText(){return Object(j["translate"])("General_LearnMore",Object(j["externalLink"])("https://matomo.org/faq/general/faq_27245"),"</a>")},mailToLink(){return`mailto:${this.contactEmail}?${j["MatomoUrl"].stringify({subject:Object(j["translate"])("TwoFactorAuth_NotPossibleToLogIn"),body:Object(j["translate"])("TwoFactorAuth_LostAuthenticationDevice","\n\n","\n\n",this.piwikUrl||"","\n\n",this.userLogin,Object(j["externalRawLink"])("https://matomo.org/faq/how-to/faq_27248"))})}`},logoutLink(){return"?"+j["MatomoUrl"].stringify({module:this.loginModule,action:"logout"})},formDataAttributes(){return Object.fromEntries(this.formData.attributes.split(/\s+/g).filter(e=>e).map(e=>e.split("=")).map(([e,t])=>[e,j["Matomo"].helper.htmlDecode(t.substr(1,t.length-2))]))}}});xe.render=De;var Me=xe;const Le={class:"successMessage"},Re=Object(a["createElementVNode"])("br",null,null,-1),qe=["href"];function Ue(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(l,{class:"twoFactorSetupFinished"},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("h2",Le,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupFinishedTitle")),1),Object(a["createElementVNode"])("h3",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_SetupFinishedSubtitle")),1),Object(a["createElementVNode"])("p",null,[Re,Object(a["createElementVNode"])("a",{class:"btn",href:e.userSecurityLink},Object(a["toDisplayString"])(e.translate("General_Continue")),9,qe)])]),_:1})}var Pe=Object(a["defineComponent"])({components:{ContentBlock:j["ContentBlock"]},computed:{userSecurityLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"}))}}});Pe.render=Ue;var Ge=Pe;const He=["innerHTML"],$e={key:0},Ie={class:"twoFaStatusEnabled"},ze={key:1},Qe={key:0},Xe=Object(a["createElementVNode"])("br",null,null,-1),Ye=Object(a["createElementVNode"])("br",null,null,-1),We=["href"],Je={key:1},Ke=["href"],Ze=["href"],et=["value"],tt=["href"],ot={key:2},nt=Object(a["createElementVNode"])("br",null,null,-1),rt=Object(a["createElementVNode"])("br",null,null,-1),at=["href"],ct={id:"confirmDisable2FA",class:"ui-confirm",ref:"confirmDisable2FA"},lt=["value"],it=["value"];function st(e,t,o,n,r,c){const l=Object(a["resolveComponent"])("ContentBlock");return Object(a["openBlock"])(),Object(a["createBlock"])(l,{"content-title":e.contentTitle,class:"userSettings2FA"},{default:Object(a["withCtx"])(()=>[Object(a["createElementVNode"])("p",{innerHTML:e.$sanitize(e.twoFactorAuthIntro)},null,8,He),e.isEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",$e,[Object(a["createElementVNode"])("strong",Ie,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_TwoFactorAuthenticationIsEnabled")),1)])):Object(a["createCommentVNode"])("",!0),e.isEnabled?(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",ze,[e.isForced?(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Qe,[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.translate("TwoFactorAuth_TwoFactorAuthenticationRequired"))+" ",1),Xe,Ye,Object(a["createElementVNode"])("a",{class:"btn btn-link enable2FaLink",href:e.setupTwoFactorAuthLink,style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ConfigureDifferentDevice")),9,We)])):(Object(a["openBlock"])(),Object(a["createElementBlock"])("span",Je,[Object(a["createElementVNode"])("a",{class:"btn btn-link enable2FaLink",href:e.setupTwoFactorAuthLink,style:{"margin-right":"3.5px"}},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ConfigureDifferentDevice")),9,Ke),Object(a["createElementVNode"])("a",{href:e.disableTwoFactorAuthLink,style:{display:"none"},id:"disable2fa"},"disable2fa",8,Ze),Object(a["createElementVNode"])("input",{type:"button",class:"btn btn-link disable2FaLink",onClick:t[0]||(t[0]=t=>e.onDisable2FaLinkClick()),value:e.translate("TwoFactorAuth_DisableTwoFA"),style:{"margin-right":"3.5px"}},null,8,et)])),Object(a["createElementVNode"])("a",{class:"btn btn-link showRecoveryCodesLink",href:e.showRecoveryCodesLink},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ShowRecoveryCodes")),9,tt)])):(Object(a["openBlock"])(),Object(a["createElementBlock"])("p",ot,[Object(a["createElementVNode"])("strong",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_TwoFactorAuthenticationIsDisabled")),1),nt,rt,Object(a["createElementVNode"])("a",{class:"btn btn-link enable2FaLink",href:e.setupTwoFactorAuthLink},Object(a["toDisplayString"])(e.translate("TwoFactorAuth_EnableTwoFA")),9,at)])),Object(a["createElementVNode"])("div",ct,[Object(a["createElementVNode"])("h2",null,Object(a["toDisplayString"])(e.translate("TwoFactorAuth_ConfirmDisableTwoFA")),1),Object(a["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,lt),Object(a["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,it)],512)]),_:1},8,["content-title"])}var ut=Object(a["defineComponent"])({props:{isEnabled:Boolean,isForced:Boolean,disableNonce:{type:String,required:!0}},components:{ContentBlock:j["ContentBlock"]},computed:{contentTitle(){const e=Object(j["translate"])("TwoFactorAuth_TwoFactorAuthentication"),t=Object(j["translate"])("TwoFactorAuth_TwoFAShort");return`${e} (${t})`},twoFactorAuthIntro(){return Object(j["translate"])("TwoFactorAuth_TwoFactorAuthenticationIntro",Object(j["externalLink"])("https://matomo.org/faq/general/faq_27245"),"</a>")},setupTwoFactorAuthLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"TwoFactorAuth",action:"setupTwoFactorAuth"}))},disableTwoFactorAuthLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"TwoFactorAuth",action:"disableTwoFactorAuth",disableNonce:this.disableNonce}))},showRecoveryCodesLink(){return"?"+j["MatomoUrl"].stringify(Object.assign(Object.assign({},j["MatomoUrl"].urlParsed.value),{},{module:"TwoFactorAuth",action:"showRecoveryCodes"}))}},methods:{onDisable2FaLinkClick(){const e=this.disableNonce;j["Matomo"].helper.modalConfirm(this.$refs.confirmDisable2FA,{yes(){j["MatomoUrl"].updateUrl({module:"TwoFactorAuth",action:"disableTwoFactorAuth",disableNonce:e})}})}}});ut.render=st;var dt=ut;
|
|
/*!
|
|
* Matomo - free/libre analytics platform
|
|
*
|
|
* @link https://matomo.org
|
|
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
|
*/}})}));
|
|
//# sourceMappingURL=TwoFactorAuth.umd.min.js.map
|