PageSourceSearch

https://cdn.taxesforexpats.com/packs/static/assets/login-mfa-cgEByDf9.js

js taxesforexpats.com collected 2026-09-24 20:39:50 UTC 8,882 bytes, 1 lines download raw bytes

1import{f as I}from"./form-DkSe4Wiu.js";import{d as L,H as S,e as F,f as m,g as i,o as n,k as t,w as c,t as f,E as p,h as u,j as x,p as _,y as V,z as A,F as y,G as M,dR as z,s as D,q as k,dX as N}from"./static-HHFhJJrl.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"81d3b500fd61290dd1c648d1ba25d688e2151dcb"}}catch{}})();try{(function(){var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="e07bf983-81ef-4e12-a117-8a5d5071e95c",e._sentryDebugIdIdentifier="sentry-dbid-e07bf983-81ef-4e12-a117-8a5d5071e95c")})()}catch{}const $={name:"choose-phone",mixins:[I],props:{phones:{type:Array,default:()=>[]}},data:function(){return{showLoader:!1,error:null}},methods:{onSubmit(){this.willvalidate(this.$refs.mfaForm)&&(this.showLoader=!0,S.post("/mfa_verification",new FormData(this.$refs.mfaForm)).then(()=>{this.error=null},e=>{this.error=e.body.error}).finally(()=>{this.showLoader=!1}))}}},C=e=>(V("data-v-53a42326"),e=e(),A(),e),q={class:"login-page__buttons"},B=C(()=>t("hr",null,null,-1)),R={class:"font-size-14 text-align-left"},K={class:"additionals-between"},P={key:0,class:"form-control-feedback error"},H=C(()=>t("div",{class:"login-page__buttons login tw-flex-1 login-page__buttons--inline"},[t("input",{type:"submit",class:"button btn-blue bold",value:"Send code"})],-1));function O(e,o,s,g,E,r){const b=F("tfx-multiselect"),v=m("willvalidate");return n(),i("div",q,[B,t("span",R," We've seen that you have added "+f(s.phones.length)+" phone numbers in account. Which number would you like us to send code to? ",1),c((n(),i("form",{class:u([{loader:e.showLoader},"login-page__form"]),ref:"mfaForm",onSubmit:o[0]||(o[0]=p((...d)=>r.onSubmit&&r.onSubmit(...d),["prevent"])),"data-hs-do-not-collect":!0},[t("div",K,[t("div",{class:u(["tw-mr-[10px] full-width form-field validate",{val
1idate:!0,"server-error":!!e.error}])},[x(b,{options:s.phones.map(d=>({value:d.id,text:d.number})),name:"phone_id",required:"true","ignore-inline-options":!0,searchable:!1,placeholder:"Select phone number",class:u(["validate",{validate:!0,"server-error":!!e.error}])},null,8,["options","class"]),e.error?(n(),i("span",P,f(e.error),1)):_("",!0)],2),H])],34)),[[v]])])}const W=L($,[["render",O],["__scopeId","data-v-53a42326"]]),l=6,j={name:"login-mfa",components:{"choose-phone":W},mixins:[I],props:{phones:{type:Array,default:()=>[]},enrolment:{type:Boolean,default:!1},qr:{type:String,default:null},rememberDays:{type:Number,default:90}},data:function(){return{code:null,digits:Array(l).fill(""),showLoader:!1,error:null,sendSms:!1,showSimpleError:!0}},computed:{enrolmentCode(){return this.digits.join("")}},mounted(){this.$nextTick(()=>{this.enrolment?this.focusDigit(0):this.$refs.codeInput?.focus()})},methods:{onCodeFocus(){this.error&&(this.code=null,this.error=null)},onDigitInput(e,o){const s=o.target.value.replace(/\D/g,"");if(this.error=null,s.length>1){this.spreadDigits(s),o.target.value=this.digits[e];return}this.digits[e]=s,o.target.value=s,s&&e<l-1&&this.focusDigit(e+1)},onDigitKeydown(e,o){this.error=null,!(o.key!=="Backspace"||this.digits[e]||e===0)&&(o.preventDefault(),this.digits[e-1]="",this.focusDigit(e-1))},onDigitPaste(e){const o=e.clipboardData||window.clipboardData,s=(o?o.getData("text"):"").replace(/\D/g,"");this.error=null,s&&(e.preventDefault(),this.spreadDigits(s))},spreadDigits(e){const o=e.slice(0,l).split("");this.digits=Array(l).fill(""),o.forEach((s,g)=>{this.digits[g]=s}),this.focusDigit(Math.min(o.length,l-1))},focusDigit(e){this.$nextTick(()=>{const o=this.$refs.digitInput&&this.$refs.digitInput[e];o&&(o.focus(),o.select&&o.select())})},onSubmitLogin(){if(this.enrolment){if(this.enrolmentCode.length!==l){this.error=`Enter the ${l}-digit code`;return}}else if(!this.willvalidate(this.$refs.mfaSessionForm))return;this.showLoader=!0,S.post("/user_mfa_sessions",new FormData(this.$refs.mfaSessionForm)).then(()=>{this.errors=null},e=>{this.error=e.body.error,this.enrolment&&(this.digits=Array(l).fill(""),this.focusDigit(0))}).finally(()=>{this.showLoader=!1})},onSubmitLoginViaSMS(){S.post("/mfa_verification").catch(e=>{N(e.body.error,{type:"error"})})}}},G=t("div",{class:"login-page__title"}," Set up two-factor authentication ",-1),Q=t("div",{class:"login-page__text"}," Two-factor authentication has been activated for your account. Scan this code in your authenticator app, then enter the code it shows to confirm the setup. ",-1),X={class:"tw-flex tw-items-start tw-gap-[16px] tw-mb-[16px]"},U=["src"],Y=t("ol",{class:"font-size-14 tw-list-decimal tw-pl-[18px]"},[t("li",null,"Open the two-factor authentication app on your device."),t("li",null,"Add an account and scan this code."),t("li",null,"Enter the 6-digit code the app shows for TFX.")],-1),J={class:"tw-mb-[5px]"},Z=t("div",{class:"tw-mb-[5px]"},[t("span",{class:"font-size-14"},"Verification code")],-1),ee={class:"tw-flex tw-gap-[8px]"},te=["value","disabled","onInput","onKeydown"],oe={key:0,class:"form-control-feedback error"},se=["value"],ie=t("div",{class:"login-page__title"}," Two-factor authentication ",-1),ne=t("div",{class:"login-page__text"}," Open the two-factor authentication app on your device to view your authentication code and verify your identity. ",-1),re={class:"tw-mb-[5px]"},ae=t("div",{class:"additionals-between tw-mb-[5px]"},[t("span",{class:"font-size-14"},"Authentication code"),t("a",{href:"https://help.taxesforexpats.com/en/articles/6573080-two-factor-authentication-2fa",target:"_blank",class:"link font-size-14",rel:"nofollow noopener noreferrer"}," What’s this? ")],-1),le={key:0,class:"form-control-feedback error"},de={class:"additionals-between"},ce={class:"tw-mb-[10px]"},ue=t("input",{id:"browser_remember_me",name:"remember_browser",type:"checkbox",class:"login-page__form-checkbox",value:"1"},null,-1),he={class:"text",for:"browser_remember_me"},fe=t("div",{class:"login-page__buttons login"},[t("input",{type:"submit",class:"button button__email",value:"Verify","data-test":"mfaSubmit"})],-1),me={key:0,class:"login-page__buttons tw-mt-5"},pe={key:0},_e={class:"text-align-center"},ge={key:1,class:"text-align-center"},be={class:"link btn"},ve=t("br",null,null,-1),we={key:2},ye=t("button",{class:"link tw-mt-5"}," Can't do it? Try logging in via SMS ",-1),Se=[ye];function De(e,o,s,g,E,r){const b=F("choose-phone"),v=m("only-latin"),d=m("willvalidate"),T=m("modal-dialog");return n(),i("div",null,[c((n(),i("form",{"data-test":"mfaSessionForm",ref:"mfaSessionForm",class:u([{loader:e.showLoader},"login-page__form"]),onSubmit:o[3]||(o[3]=p((...a)=>r.onSubmitLogin&&r.onSubmitLogin(...a),["prevent"])),"data-hs-do-not-collect":!0},[s.enrolment?(n(),i(y,{key:0},[G,Q,t("div",X,[t("img",{src:s.qr,alt:"QR code",width:"146",height:"146","data-test":"mfaEnrolmentQr"},null,8,U),Y]),t("div",J,[Z,t("div",{class:u({validate:!0,"server-error":!!e.error})},[t("div",ee,[(n(!0),i(y,null,M(e.digits,(a,w)=>(n(),i("input",{key:w,ref_for:!0,ref:"digitInput",class:"input login-form__input tw-w-[32px] tw-text-center",type:"text",inputmode:"numeric",autocomplete:"one-time-code",maxlength:"1","data-test":"mfaEnrolmentDigit",value:a,disabled:e.showLoader,onInput:h=>r.onDigitInput(w,h),onKeydown:h=>r.onDigitKeydown(w,h),onPaste:o[0]||(o[0]=h=>r.onDigitPaste(h))},null,40,te))),128))]),e.error?(n(),i("span",oe,f(e.error),1)):_("",!0)],2),t("input",{type:"hidden",name:"mfa_code",value:r.enrolmentCode},null,8,se)])],64)):(n(),i(y,{key:1},[ie,ne,t("div",re,[ae,t("div",{class:u({validate:!0,"server-error":!!e.error})},[c(t("input",{class:"input login-form__input","onUpdate:modelValue":o[1]||(o[1]=a=>
1e.code=a),ref:"codeInput",id:"code_input",name:"mfa_code",label:"Authentication code",type:"text",required:"",onFocus:o[2]||(o[2]=(...a)=>r.onCodeFocus&&r.onCodeFocus(...a))},null,544),[[z,e.code],[v]]),e.error?(n(),i("span",le,f(e.error),1)):_("",!0)],2)]),t("div",de,[t("div",ce,[ue,t("label",he," Remember this device for "+f(s.rememberDays)+" days ",1)])])],64)),fe],34)),[[d]]),s.enrolment?_("",!0):(n(),i("div",me,[s.phones.length>1?(n(),i("div",pe,[t("div",_e,[c(t("a",{class:"link",href:"#",onClick:o[4]||(o[4]=p(a=>e.sendSms=!0,["prevent"]))}," Can't do it? Try logging in via SMS ",512),[[D,!e.sendSms]])]),c(x(b,{phones:s.phones},null,8,["phones"]),[[D,e.sendSms]])])):s.phones.length===0?(n(),i("div",ge,[c((n(),i("span",be,[k(" Can't do it?"),ve,k(" Please contact support. ")])),[[T,"/mfa_support",void 0,{post:!0}]])])):(n(),i("div",we,[t("form",{"data-test":"form",ref:"form",class:"text-align-center",onSubmit:o[5]||(o[5]=p((...a)=>r.onSubmitLoginViaSMS&&r.onSubmitLoginViaSMS(...a),["prevent"]))},Se,544)]))]))])}const Le=L(j,[["render",De]]);export{Le as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.