{"version":3,"sources":["webpack:///./src/views/auth/pages/Login.vue?b257","webpack:///./src/views/auth/pages/Login.vue","webpack:///./src/views/auth/pages/Login.vue?329c","webpack:///./src/views/auth/pages/Login.vue?cce4"],"names":["render","_vm","this","_h","$createElement","_c","_self","isAuthenticated","_e","staticClass","staticStyle","_v","_s","$t","VForm","on","$event","preventDefault","submit","VTextField","attrs","emailErrors","model","value","callback","$$v","emailInput","expression","passwordErrors","showPass","passwordInput","VBtn","loading","staticRenderFns","Login","errors","$v","$dirty","email","push","required","$touch","$invalid","length","clearEverything","loginUser","password","then","authenticateDevice","deviceCode","$route","query","end","data","api","post","res","console","log","$router","msg","toString","error","Vue","__decorate","Getter","Action","Component","mixins","validationMixin","validations","component"],"mappings":"+JAIIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAASF,EAAIM,gBAAqvDN,EAAIO,KAAxuDH,EAAG,MAAM,CAACI,YAAY,gBAAgB,CAACJ,EAAG,MAAM,CAACA,EAAG,KAAK,CAACK,YAAY,CAAC,MAAQ,SAAS,CAACT,EAAIU,GAAG,IAAIV,EAAIW,GAAGX,EAAIY,GAAG,uBAAuB,OAAOR,EAAGS,EAAA,KAAM,CAACL,YAAY,iBAAiBM,GAAG,CAAC,OAAS,SAASC,GAAgC,OAAxBA,EAAOC,iBAAwBhB,EAAIiB,OAAOF,MAAW,CAACX,EAAG,MAAM,CAACI,YAAY,SAAS,CAACR,EAAIU,GAAGV,EAAIW,GAAGX,EAAIY,GAAG,0BAA0BR,EAAGc,EAAA,KAAW,CAACC,MAAM,CAAC,KAAO,QAAQ,iBAAiBnB,EAAIoB,YAAY,MAAQpB,EAAIY,GAAG,iCAAiC,SAAW,IAAIS,MAAM,CAACC,MAAOtB,EAAc,WAAEuB,SAAS,SAAUC,GAAMxB,EAAIyB,WAAWD,GAAKE,WAAW,gBAAgBtB,EAAG,MAAM,CAACI,YAAY,6CAA6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CAJf/B,EAAK,gBAPzBiC,eAAU,CACTC,OAAQ,CAACC,sBACTC,YAAa,CACX5C,WAAY,CAAEc,uBAAUF,kBACxBR,cAAe,CAAEU,4BAGAN,WCxE+Y,I,YCOhaqC,EAAY,eACd,EACAvE,EACAiC,GACA,EACA,KACA,KACA,MAIa,aAAAsC,E","file":"assets/js/chunk-2d0d7311.273b04f2.js","sourcesContent":["import { VBtn } from 'vuetify/lib/components/VBtn';\nimport { VForm } from 'vuetify/lib/components/VForm';\nimport { VTextField } from 'vuetify/lib/components/VTextField';\n\nvar render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.isAuthenticated)?_c('div',{staticClass:\"form-wrapper\"},[_c('div',[_c('h1',{staticStyle:{\"width\":\"100%\"}},[_vm._v(\" \"+_vm._s(_vm.$t(\"loginSection.title\"))+\" \")]),_c(VForm,{staticClass:\"form-container\",on:{\"submit\":function($event){$event.preventDefault();return _vm.submit($event)}}},[_c('div',{staticClass:\"label\"},[_vm._v(_vm._s(_vm.$t(\"loginSection.email\")))]),_c(VTextField,{attrs:{\"type\":\"email\",\"error-messages\":_vm.emailErrors,\"label\":_vm.$t('loginSection.emailPlaceHolder'),\"outlined\":\"\"},model:{value:(_vm.emailInput),callback:function ($$v) {_vm.emailInput=$$v},expression:\"emailInput\"}}),_c('div',{staticClass:\"d-flex justify-space-between align-center\"},[_c('div',{staticClass:\"label\"},[_vm._v(_vm._s(_vm.$t(\"loginSection.password\")))]),_c('router-link',{staticClass:\"button-link\",attrs:{\"to\":\"/auth/forgotPassword\"}},[_vm._v(\" \"+_vm._s(_vm.$t(\"loginSection.forgotPass\"))+\" \")])],1),_c(VTextField,{attrs:{\"outlined\":\"\",\"error-messages\":_vm.passwordErrors,\"label\":_vm.$t('loginSection.password'),\"append-icon\":_vm.showPass ? 'mdi-eye-off' : 'mdi-eye',\"type\":_vm.showPass ? 'text' : 'password'},on:{\"click:append\":function($event){_vm.showPass = !_vm.showPass}},model:{value:(_vm.passwordInput),callback:function ($$v) {_vm.passwordInput=$$v},expression:\"passwordInput\"}}),_c('div',{staticClass:\"d-flex justify-center\"},[_c(VBtn,{attrs:{\"type\":\"submit\",\"elevation\":\"0\",\"color\":\"primary\",\"loading\":_vm.loading,\"disabled\":_vm.loading}},[_c('span',[_vm._v(_vm._s(_vm.$t(\"loginSection.signIn\")))])])],1)],1)],1),_c('div',{staticClass:\"text-center mt-6 register-prompt\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"loginSection.dontHaveAccount\"))+\" \"),_c('router-link',{staticClass:\"button-link semi-bold\",attrs:{\"to\":\"/auth/register\"}},[_vm._v(_vm._s(_vm.$t(\"loginSection.register\")))])],1)]):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport Vue from \"vue\";\r\nimport { Action, Getter } from \"vuex-class\";\r\nimport { validationMixin } from \"vuelidate\";\r\nimport { Component } from \"vue-property-decorator\";\r\nimport { required, email } from \"vuelidate/lib/validators\";\r\nimport api from \"@/core/utils/api\";\r\n\r\ntype LoginType = {\r\n email: string;\r\n password: string;\r\n};\r\n\r\n@Component({\r\n mixins: [validationMixin],\r\n validations: {\r\n emailInput: { required, email },\r\n passwordInput: { required },\r\n },\r\n})\r\nexport default class Login extends Vue {\r\n @Getter(\"profile/loading\") loading!: boolean;\r\n @Action(\"clearEverything\") clearEverything!: (reroute: boolean) => void;\r\n @Action(\"profile/loginUser\") loginUser!: (data: LoginType) => Promise;\r\n @Getter(\"profile/isAuthenticated\") isAuthenticated!: boolean;\r\n\r\n showPass = false;\r\n emailInput = \"\";\r\n passwordInput = \"\";\r\n\r\n get emailErrors(): any[] {\r\n const errors: any[] = [];\r\n if (!this.$v.emailInput!.$dirty) return errors;\r\n !this.$v.emailInput!.email &&\r\n errors.push(this.$t(\"loginSection.invalidEmail\"));\r\n !this.$v.emailInput!.required &&\r\n errors.push(this.$t(\"loginSection.emailRequired\"));\r\n return errors;\r\n }\r\n\r\n get passwordErrors(): any[] {\r\n const errors: any[] = [];\r\n if (!this.$v.passwordInput!.$dirty) return errors;\r\n !this.$v.passwordInput!.required &&\r\n errors.push(this.$t(\"loginSection.passRequired\"));\r\n return errors;\r\n }\r\n\r\n async submit(): Promise {\r\n this.$v.$touch();\r\n if (!this.$v.$invalid && this.passwordErrors.length === 0) {\r\n this.clearEverything(false);\r\n this.loginUser({\r\n email: this.emailInput,\r\n password: this.passwordInput,\r\n }).then(async () => {\r\n await this.authenticateDevice();\r\n });\r\n }\r\n }\r\n\r\n async authenticateDevice() {\r\n const { deviceCode } = this.$route.query;\r\n if (!deviceCode) return;\r\n\r\n try {\r\n const end = \"/api/Account/ActivateDeviceCode\";\r\n const data = { deviceCode };\r\n await api.post(end, data).then(async res => {\r\n console.log(res.data);\r\n await this.$router.push(\r\n `/auth/device/activate?deviceCode=${deviceCode}&success=true`,\r\n );\r\n });\r\n } catch (error) {\r\n const msg = this.$t(\"registerDeviceSection.couldNotGetCode\").toString();\r\n console.error(msg);\r\n }\r\n }\r\n\r\n beforeDestroy() {\r\n this.emailInput = \"\";\r\n this.passwordInput = \"\";\r\n }\r\n\r\n mounted() {\r\n if (this.isAuthenticated) this.authenticateDevice();\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--15-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Login.vue?vue&type=template&id=7f4e5c4c&\"\nimport script from \"./Login.vue?vue&type=script&lang=ts&\"\nexport * from \"./Login.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}