1import{g as m,f as _,_ as g}from"./B6g63lXX.js";import{a5 as p,a7 as o,V as h,as as f,at as u,aP as v,a$ as w,ar as k,au as c,av as y,ay as $}from"./C7796JS1.js";import{A as l}from"./DwQJ6gv8.js";import{g as E}from"./CEoWXvts.js";import"./_cs_qknm.js";const x=p({components:{QrAlertBox:_,CodyCard:m},setup(){h({title:"Success"})},data(){return{generalError:null}},async mounted(){await this.doAutoSignup()},methods:{async doAutoSignup(){await this.ensureNotPreviousLoggedInUser();const e=(this._.provides[o]||this.$route).query.email,a=(this._.provides[o]||this.$route).query.magicLinkToken;if(!a){window.console.warn("No automatic login, magicLinkToken is missing");return}const r=(this._.provides[o]||this.$route).query.utm_parameters;let s="";r&&(s="&utm_parameters="+r);try{const t=await l.signIn(e);if((await l.sendCustomChallengeAnswer(t,a)).signInUserSession){window.console.info("Success for automatic login");const n=await(await l.currentSession()).getIdToken().getJwtToken();window.location.href=this.$config.public.APP_DEFAULT_URL+"/oauth/cognito?token="+n+s}else window.console.warn("automatiLoginPage.spec.jsc login FAILED"),this.setGeneralError("email_activation.success.error.auto_login_failed.message","email_activation.success.error.auto_login_failed.link_text","/")}catch(t){const i=E(t);switch(i){case"AccessTokenRevokedException":this.$isFeatureEnabled("gpa-188-delayed-email-verification",(this._.provides[o]||this.$route).query.email,{is_e2e_test_user:typeof(this._.provides[o]||this.$route).query.email=="string"&&(this._.provides[o]||this.$route).query.email.includes("@inbox.mailtrap.io"),email:(this._.provides[o]||this.$route).query.email?.toString()??""})&&await this.$router.push("/");break;case"UserLambdaValidationException":console.error(t),this.setGeneralError("email_activation.success.error.auto_login_failed.message","email_activation.success.error.auto_login_failed.link_text","/");break;default:this.setGeneralError(this.$t("login.form.errors.default")+" - "+i),console.error(t)}}},async ensureNotPreviousLoggedInUser(){try{await l.signOut({global:!0})}catch(e){console.error(e)}},setGeneralError(e,a,r){const s=this.$t(e)||e,t=a?this.$t(a):void 0;this.generalError={message:s,linkText:t,linkAction:r,isInfo:!0}}}});function A(e,a,r,s,t,i){const n=w("qr-alert-box"),d=m;return k(),f(v,{"data-test":"qr-email-activation-ok-page"},{default:u(()=>[c(y,{justify:"center",align:"center",class:"ma-0"},{default:u(()=>[c($,{cols:"12",sm:"8",md:"6",lg:"5",class:"py-0"},{default:u(()=>[c(n,{"data-test":"qr-email-activation-alert",error:e.generalError},null,8,["error"])]),_:1})]),_:1}),c(d,{"data-test":"qr-forgot-password-success-card","cody-image-key":"locked",title:e.$t("email_activation.success.title"),"main-text":e.$t("email_activation.success.text"),"action-text":e.$t("email_activation.success.auto_login.action_text"),"action-link":"/"},null,8,["title","main-text","action-text"])]),_:1})}const P=g(x,[["render",A]]);export{P 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.