1"use strict";(self["webpackChunkaura_admin"]=self["webpackChunkaura_admin"]||[]).push([[8144],{1249:function(e,t,s){s.r(t),s.d(t,{default:function(){return g}});var a=function(){var e=this,t=e._self._c;return t("v-main",[t("v-container",{staticClass:"mt-md-15"},[t("v-row",{attrs:{justify:"center",align:"center"}},[e.isVisible&&(!e.error||e.error.length<1)?t("v-col",{staticClass:"text-center mt-md-5",attrs:{cols:"12",md:"4",lg:"3",sm:"6"}},[t("p",{staticClass:"google-font",staticStyle:{"font-size":"2.5em"}},[e._v("Team Onboard")]),t("v-divider",{staticClass:"mb-md-10"}),t("br"),t("v-text-field",{staticClass:"ma-0 pa-0",attrs:{label:"Email",disabled:"",outlined:""},model:{value:e.userData.email,callback:function(t){e.$set(e.userData,"email",t)},expression:"userData.email"}}),t("v-text-field",{staticClass:"ma-0 pa-0",attrs:{label:"Password","append-icon":e.show1?"mdi-eye":"mdi-eye-off",type:e.show1?"text":"password",placeholder:"Your Password",outlined:""},on:{"click:append":function(t){e.show1=!e.show1}},model:{value:e.userData.password,callback:function(t){e.$set(e.userData,"password",t)},expression:"userData.password"}}),t("v-text-field",{staticClass:"ma-0 pa-0",attrs:{label:"Confirm Password","append-icon":e.show1?"mdi-eye":"mdi-eye-off",type:e.show2?"text":"password",placeholder:"Confirm Password",outlined:""},on:{"click:append":function(t){e.show2=!e.show2}},model:{value:e.cpassword,callback:function(t){e.cpassword=t},expression:"cpassword"}}),t("v-btn",{staticClass:"primary",staticStyle:{height:"38px",width:"150px"},attrs:{loading:e.loading,depressed:""},on:{click:e.onBoardUser}},[e._v("Onboard")])],1):!e.successDialog&&e.error.length>1?t("v-col",{staticClass:"google-font text-center",attrs:{sm:"4"}},[t("p",{staticClass:"google-font",staticStyle:{"font-size":"2.5em"}},[e._v("Team Onboard")]),t("v-divider"),t("p",{staticClass:"mt-md-10 mt-4",staticStyle:{"font-size":"1.2em"}},[e._v(e._s(e.error))]),t("v-btn",{staticClass:"mt-3",attrs:{to:"/login",color:"primary",depressed:""}},[e._v("Back to Login")])],1):e._e()],1),t("v-dialog",{attrs:{width:"500"},model:{value:e.successDialog,callback:function(t){e.successDialog=t},expression:"successDialog"}},[t("v-card",[t("v-card-title",{staticClass:"google-font grey lighten-2",staticStyle:{"font-size":"1.3em"}},[e._v(" Success ")]),t("v-card-text",[t("p",{staticClass:"google-font mt-4 mb-0",staticStyle:{"font-size":"1.2em"}},[e._v(" Your account is created ")])]),t("v-divider"),t("v-card-actions",[t("v-spacer"),t("v-btn",{attrs:{color:"primary",text:""},on:{click:e.dialogOkay}},[e._v(" Okay ")])],1)],1)],1)],1)],1)},n=[],o=s(7546),r=s(4634),i=s(8643),c=(s(6099),s(806)),l={getUserById:function(e){return new Promise((function(t,s){try{c.A.firestore.collection("teamOnboard").doc(e).get().then((function(e){e.exists?t(e.data()):s({success:!1,message:"User Not exists"})}))}catch(a){s(a)}}))},deleteTempUse:function(e){return new Promise((function(t,s){c.A.firestore.collection("teamOnboard").doc(e).delete().then((function(){t({success:!0})})).catch((function(e){s(e)}))}))},addOnBoardUserToUserManagement:function(e){return new Promise((function(t,s){c.A.firestore.collection("users").doc(e.uid).set({disabled:!1,id:e.id,uid:e.uid,userType:e.userType}).then((function(e){t({success:!0})})).catch((function(e){s(e)}))}))},updateTeamWithUID:function(e,t){return new Promise((function(s,a){c.A.firestore.collection("team").doc(t).update({uid:e}).then((function(e){s({success:!0})})).catch((function(e){a(e)}))}))}},d=l,u=s(5353),m={name:"teamOnboard",data:function(){return{show1:!1,show2:!1,loading:!1,successDialog:!1,isVisible:!1,error:"",cpassword:"",finalUser:{},userData:{password:""}}},computed:(0,i.A)({},(0,u.aH)(["unsub"])),mounted:function(){var e=this;d.getUserById(this.$route.params.id).then((function(t){e.finalUser=t,e.userData=(0,i.A)({},t),e.isVisible=!0})).catch((function(t){e.isVisible=!1,e.error=t.message,console.log(t)}))},methods:{onBoardUser:function(){var e=this;return(0,r.A)((0,o.A)().mark((function t(){var s,a,n,r;return(0,o.A)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.loading=!0,e.cpassword!=e.userData.password){t.next=33;break}return t.prev=2,e.unsub(),t.next=6,c.A.auth.createUserWithEmailAndPassword(e.finalUser.email,e.userData.password);case 6:return s=t.sent,t.next=9,c.A.auth.signOut();case 9:return t.next=11,d.deleteTempUse(e.$route.params.id);case 11:if(a=t.sent,a.success){t.next=14;break}throw{message:"Something went wrong"};case 14:return n=(0,i.A)({uid:s.user.uid},e.finalUser),t.next=17,d.addOnBoardUserToUserManagement(n);case 17:return t.sent,t.next=20,d.updateTeamWithUID(n.uid,n.id);case 20:if(r=t.sent,r.success){t.next=23;break}throw r;case 23:e.loading=!0,e.successDialog=!0,t.next=31;break;case 27:t.prev=27,t.t0=t["catch"](2),console.log(t.t0),e.loading=!1;case 31:t.next=35;break;case 33:alert("Password Not Match"),e.loading=!1;case 35:case"end":return t.stop()}}),t,null,[[2,27]])})))()},dialogOkay:function(){this.successDialog=!1,window.location.href="/login"}}},f=m,p=s(1656),h=(0,p.A)(f,a,n,!1,null,null,null),g=h.exports}}]);
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.