{"version":3,"sources":["webpack:///./node_modules/@glittr/frontend-core/src/services/generated/types/model/resource/TokenRequestModel.ts","webpack:///./node_modules/@glittr/frontend-core/src/services/viewModel/resource/TokenRequestViewModel.ts","webpack:///./src/views/pages/_exterior/login.vue?52ab","webpack:///./src/views/pages/_exterior/login.vue?8a73","webpack:///./src/views/pages/_exterior/login.vue?27a5","webpack:///./src/views/pages/_exterior/login.vue","webpack:///./node_modules/@glittr/frontend-core/src/plugins/validation/queryBuilder.ts"],"names":["this","dto","userName","value","password","shareId","transformFromQuery","queries","schema","queryBuilder","properties","required","minLength","$config","values","render","_vm","_h","$createElement","_c","_self","staticClass","attrs","_v","_s","$t","login","model","callback","$$v","$set","expression","on","$event","type","indexOf","_k","keyCode","key","doLogin","apply","arguments","isLoading","requestError","gotoRegister","staticRenderFns","extend","auth","layout","data","TokenRequestViewModel","undefined","computed","redirectPath","$route","query","redirect","mounted","loadQRData","methods","$router","currentRoute","username","email","push","validate","$auth","then","user","statusId","isInRole","catch","error","status","message","component","deepSetProperty","property","setRequired","propertyPath","split","currentNode","nodes","forEach","prop","i","lastNode","length","lastProp","constValues","propValues","propsRequired","Object","keys","const","if","ifNot","not","thenRequired","propNames","thenValue","elseRequired","else","elseValue","computedRequired","computedProps","filteredValue","sameAs","isObject","pattern","$validation","REF_PREFIX","nestedProps"],"mappings":"wLASA,2B,+CAoBA,OApBwD,oBAGtD,sBAAI,uBAAQ,C,IAAZ,WAAiB,OAAOA,KAAKC,IAAIC,U,IACjC,SAAaC,GAASH,KAAKC,IAAIC,SAAWC,G,gCAG1C,sBAAI,uBAAQ,C,IAAZ,WAAiB,OAAOH,KAAKC,IAAIG,U,IACjC,SAAaD,GAASH,KAAKC,IAAIG,SAAWD,G,gCAG1C,sBAAI,sBAAO,C,IAAX,WAAgB,OAAOH,KAAKC,IAAII,S,IAChC,SAAYF,GAASH,KAAKC,IAAII,QAAUF,G,gCAE9B,YAAAG,mBAAV,SAA6BC,GAE3BP,KAAKC,IAAIC,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aC,GACX,MAAO,CAAEhC,KAAM,CAAExD,SAAUwF,KAE7BC,UAAA,SAAUV,EAAiCC,QAAA,IAAAA,OAAA,GACzC,IAAMjF,EAAaV,KAAKyF,YAAYC,EAAYC,GAChD,MAAO,CAAExB,KAAMzD,IAEjB2F,aAAA,SAAaF,GACX,MAAO,CAAEG,KAAM,CAAE3F,SAAUwF,KAE7BI,UAAA,SAAUb,EAAiCC,QAAA,IAAAA,OAAA,GACzC,IAAMjF,EAAaV,KAAKyF,YAAYC,EAAYC,GAChD,MAAO,CAAEW,KAAM5F,IAGjBA,WAAA,SAAW,GAAX,WACQ8F,EAAmB,GACzBZ,OAAOC,KAAK,GAAYV,SAAQ,SAAC7C,GAC3B,EAAWA,GAAK3B,UAClB6F,EAAiBxC,KAAK1B,MAG1B,IAAMmE,EAAgB,GActB,OAbAb,OAAOC,KAAK,GAAYV,SAAQ,SAAC7C,GAC/B,GAA6B,WAAzB,EAAWA,GAAKJ,KAApB,CAKA,IAAM,EAAiC,EAAWI,GAA7BoE,GAAL,WAAkB,iBAA5B,eAEND,EAAcnE,GAAOoE,EACjBA,EAAcC,QAAU,OAAEC,SAASH,EAAcnE,MAClDmE,EAAcnE,GAAqBuE,QAAU,UAAG,OAAIC,YAAYC,YAAU,OAAGL,EAAcC,aAT9F,CACE,IAAMK,EAAc,EAAW1E,GAAK5B,WACpC+F,EAAcnE,GAAO,EAAK5B,WAAWsG,OAUlC,CACL9E,KAAM,SACNvB,SAAU6F,EACV9F,WAAY+F,KAKH","file":"js/chunk-1e84e8fe.e22e0ab6.js","sourcesContent":["// ╭────────────────────────────────────────────────────────────────────────────────────╮\r\n// ┊ This file was automatically generated\r\n// ┊ Please do not modify manually\r\n// ┊ ©gl it 2022 - http://www.gl-it.ch\r\n// ╰────────────────────────────────────────────────────────────────────────────────────╯\r\n\r\nimport BaseModel from '../../../../../plugins/servicelayer/serviceTypes/baseModel';\r\nimport TokenRequestDTO from '../../dto/resource/TokenRequestDTO';\r\n\r\nexport default abstract class TokenRequestModel extends BaseModel {\r\n /**\r\n */\r\n get userName() { return this.dto.userName; }\r\n set userName(value) { this.dto.userName = value; }\r\n /**\r\n */\r\n get password() { return this.dto.password; }\r\n set password(value) { this.dto.password = value; }\r\n /**\r\n */\r\n get shareId() { return this.dto.shareId; }\r\n set shareId(value) { this.dto.shareId = value; }\r\n\r\n protected transformFromQuery(queries: Record): void {\r\n let value: any;\r\n this.dto.userName = queries.userName;\r\n this.dto.password = queries.password;\r\n this.dto.shareId = queries.shareId;\r\n }\r\n}\r\n","import Vue from 'vue';\r\nimport { IJSONSchema } from '../../../plugins/validation/IJSONSchema';\r\nimport queryBuilder from '../../../plugins/validation/queryBuilder';\r\nimport TokenRequestModel from '../../generated/types/model/resource/TokenRequestModel';\r\n\r\nexport default class TokenRequestViewModel extends TokenRequestModel {\r\n schema = {\r\n ...queryBuilder.properties({\r\n userName: { required: true },\r\n password: { required: true, minLength: Vue.$config.values['auth-min-password-length'] ?? 0 },\r\n }),\r\n } as IJSONSchema;\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"fill-height\"},[_c('p-row',{attrs:{\"no-gutters\":\"\",\"fill-height\":\"\"}},[_c('p-col',{attrs:{\"xs12\":\"\",\"md6\":\"\",\"justify-end\":\"\"}},[_c('div',{staticClass:\"exterior-section-container\"},[_c('h3',{staticClass:\"text-color-base mb-4\"},[_vm._v(\" \"+_vm._s(_vm.$t(\"page.login.page.title\"))+\" \")]),_c('p-form',{attrs:{\"model\":_vm.login,\"no-summary\":\"\"}},[_c('p-text-field',{attrs:{\"autocomplete\":\"username\",\"name\":\"username\",\"label\":_vm.$t('page.login.label.usernameOrEmail')},model:{value:(_vm.login.userName),callback:function ($$v) {_vm.$set(_vm.login, \"userName\", $$v)},expression:\"login.userName\"}}),_c('p-text-field',{attrs:{\"type\":\"password\",\"name\":\"password\",\"label\":_vm.$t('page.login.label.password')},on:{\"keyup\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }return _vm.doLogin.apply(null, arguments)}},model:{value:(_vm.login.password),callback:function ($$v) {_vm.$set(_vm.login, \"password\", $$v)},expression:\"login.password\"}})],1),_c('p-row',{staticClass:\"mt-4\",attrs:{\"align-center\":\"\",\"spacious\":\"\"}},[_c('p-col',{attrs:{\"xs6\":\"\"}},[_c('p-button',{attrs:{\"stretch\":\"\",\"loading\":_vm.isLoading,\"disabled\":_vm.isLoading},on:{\"click\":_vm.doLogin}},[_vm._v(\" \"+_vm._s(_vm.$t('page.login.button.login'))+\" \")])],1),_c('p-col',{attrs:{\"justify-end\":\"\"}},[_c('router-link',{attrs:{\"to\":\"reset-password\"}},[_vm._v(\" \"+_vm._s(_vm.$t('page.login.button.forgotPassword'))+\" \")])],1)],1),_c('p-request-alert',{model:{value:(_vm.requestError),callback:function ($$v) {_vm.requestError=$$v},expression:\"requestError\"}})],1)]),_c('p-col',{staticClass:\"color-base\",attrs:{\"xs12\":\"\",\"md6\":\"\"}},[_c('div',{staticClass:\"exterior-section-container\"},[_c('h3',{staticClass:\"mb-4\"},[_vm._v(\" \"+_vm._s(_vm.$t('page.login.label.needToRegister'))+\" \")]),_c('p',{staticClass:\"my-4 py-3 caption-1 text-color-white\"},[_vm._v(\" \"+_vm._s(_vm.$t('page.login.text.fillText'))+\" \")]),_c('p-button',{attrs:{\"stretch\":\"\",\"color\":\"white\"},on:{\"click\":_vm.gotoRegister}},[_vm._v(\" \"+_vm._s(_vm.$t('page.login.button.register'))+\" \")])],1)])],1)],1)}\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\n\n\n\n\n\n\n\n\n\n\n\nimport Vue from 'vue';\nimport TokenRequestViewModel from '@glittr/frontend-core/src/services/viewModel/resource/TokenRequestViewModel';\n\nexport default Vue.extend({\n auth: false,\n layout: 'layout-exterior',\n data: () => ({\n login: new TokenRequestViewModel(),\n isLoading: false,\n requestError: undefined as any,\n }),\n computed: {\n redirectPath(): string {\n return this.$route.query.redirect as string;\n },\n },\n mounted() {\n this.loadQRData();\n },\n methods: {\n loadQRData() {\n const query = this.$router.currentRoute?.query ?? {};\n const { username, email, registrationKey } = query as Record;\n this.login.userName = email ?? username;\n },\n gotoRegister() {\n this.$router.push('/_exterior/register');\n },\n async doLogin() {\n if (!this.login.validate()) {\n return;\n }\n this.isLoading = true;\n this.requestError = undefined;\n this.$auth.login({ username: this.login.userName, password: this.login.password })\n .then(() => {\n this.isLoading = false;\n if (this.$auth.user?.statusId === 0) {\n this.$router.push('/_exterior/verify-user/');\n } else if (this.$auth.isInRole('hostadmin', 'admin')) {\n this.$router.push('/_admin/');\n } else if (this.redirectPath) {\n this.$router.push(this.redirectPath);\n } else {\n this.$router.push('/syna/memberPortal');\n }\n })\n .catch((error: any) => {\n this.isLoading = false;\n if (error && error.status === 401) {\n this.requestError = { message: this.$t('page.login.label.wrongLogin') };\n } else {\n this.requestError = error;\n }\n });\n },\n },\n});\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-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--14-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js??ref--14-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=12de1754&\"\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","import Vue from 'vue';\r\nimport _ from '../../utils';\r\nimport { IJSONSchema } from './IJSONSchema';\r\n\r\ntype PropertiesOptions = Omit & {\r\n required?: boolean,\r\n sameAs?: string\r\n properties?: Record,\r\n};\r\n\r\nconst queryBuilder = {\r\n deepSetProperty(schema: IJSONSchema, property: string, value: Record, setRequired: boolean = false) {\r\n const propertyPath = property.split('.');\r\n let currentNode = schema ?? {};\r\n const nodes = [] as IJSONSchema[];\r\n propertyPath.forEach((prop, i) => {\r\n currentNode.properties = currentNode.properties ?? {};\r\n currentNode.type = currentNode.type ?? 'object';\r\n currentNode.properties[prop] = currentNode.properties[prop] ?? {};\r\n nodes.push(currentNode);\r\n currentNode = currentNode.properties[prop] as IJSONSchema;\r\n });\r\n const lastNode = nodes[nodes.length - 1];\r\n const lastProp = propertyPath[propertyPath.length - 1];\r\n if (setRequired) {\r\n lastNode.required = [...(lastNode.required ?? []), lastProp];\r\n }\r\n if (value) {\r\n lastNode.properties![lastProp] = { ...lastNode.properties![lastProp] as {}, ...value };\r\n }\r\n },\r\n constValues(propValues: Record, propsRequired: boolean = false) {\r\n const schema: IJSONSchema = {};\r\n Object.keys(propValues).forEach((key) => {\r\n this.deepSetProperty(schema, key, { const: propValues[key] }, propsRequired);\r\n });\r\n return schema;\r\n },\r\n if(propValues: Record, propsRequired: boolean = true) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { if: properties };\r\n },\r\n ifNot(propValues: Record, propsRequired: boolean = true) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { if: { not: properties } };\r\n },\r\n thenRequired(propNames: string[]) {\r\n return { then: { required: propNames } };\r\n },\r\n thenValue(propValues: Record, propsRequired: boolean = false) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { then: properties };\r\n },\r\n elseRequired(propNames: string[]) {\r\n return { else: { required: propNames } };\r\n },\r\n elseValue(propValues: Record, propsRequired: boolean = false) {\r\n const properties = this.constValues(propValues, propsRequired);\r\n return { else: properties };\r\n },\r\n\r\n properties(properties: Record) {\r\n const computedRequired = [] as string[];\r\n Object.keys(properties).forEach((key) => {\r\n if (properties[key].required) {\r\n computedRequired.push(key);\r\n }\r\n });\r\n const computedProps = {} as NonNullable;\r\n Object.keys(properties).forEach((key) => {\r\n if (properties[key].type === 'object') {\r\n const nestedProps = properties[key].properties;\r\n computedProps[key] = this.properties(nestedProps as Record);\r\n return;\r\n }\r\n const { required, ...filteredValue } = properties[key];\r\n // In nested cases this has already been converted above, so casting to any here\r\n computedProps[key] = filteredValue as any;\r\n if (filteredValue.sameAs && _.isObject(computedProps[key])) {\r\n (computedProps[key] as IJSONSchema).pattern = `${Vue.$validation.REF_PREFIX}${filteredValue.sameAs}`;\r\n }\r\n });\r\n return {\r\n type: 'object' as IJSONSchema['type'],\r\n required: computedRequired as IJSONSchema['required'],\r\n properties: computedProps as IJSONSchema['properties'],\r\n };\r\n },\r\n};\r\n\r\nexport default queryBuilder;\r\n"],"sourceRoot":""}