openc3-tool-base 5.19.0 → 5.20.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb7c7f5c0e62e5bbfbcd3d359d76e094e5f05013ad4126f00c37fcb2bd20e4b5
4
- data.tar.gz: b4808aadf810edf90b877ba25081ac0409ab2d81d1896caf8012214964593c3d
3
+ metadata.gz: f28fc08a93a931953ae44dc11c687eb1ec3612a3260fd3254060c3b9f66a3364
4
+ data.tar.gz: b2fda0e3fd73c574381840c418dc53e548c6b4615ce0d47768074e7a1d4c6f16
5
5
  SHA512:
6
- metadata.gz: 89a26bd17a7d33d2c7f5c7bcbe01c92a8e0264e9befc0f101779821055e10882bed3ceb6d345338f854b3601f529c4ba451f89f0144b70c93f94e825da422af8
7
- data.tar.gz: d1588994ff67239d656f643877f5afa81f76e5b1ba84de4e9a280649c84411c7224ef1b21a3353f5e6e0675e0ba8ffce1efcd7a227e58be8529652e4aac65c8e
6
+ metadata.gz: d75165457d7d5aaa98246c2abba24432382a5a880e2fc9147466c0b70f8e0f59e182f9264024eceff2f042ee94169ddafceeb46f1944fecced5048104df160cd
7
+ data.tar.gz: 440c1c836b327ab5c11d52b0f1023132c4848b01f262d32b1e92f124a9723f76c1672d9d0edf212df65d2cb133bdf8d9ca668a2b495901d7adc3f00baa0d2fb9
@@ -1,2 +1,2 @@
1
- "use strict";(self.webpackChunktool_base=self.webpackChunktool_base||[]).push([[51],{51:(s,t,e)=>{e.r(t),e.d(t,{default:()=>i});var o=function(){var s=this,t=s.$createElement,e=s._self._c||t;return e("v-card",[e("v-card-title",[s._v(" Login ")]),s._v(" "),e("v-card-subtitle",[s._v("\n "+s._s(s.isSet?"Enter the":"Create a")+"\n password to begin using OpenC3\n ")]),s._v(" "),e("v-card-text",[e("v-form",[s.isSet&&s.reset?e("v-text-field",{attrs:{type:"password",label:"Old Password"},model:{value:s.oldPassword,callback:function(t){s.oldPassword=t},expression:"oldPassword"}}):s._e(),s._v(" "),e("v-text-field",{attrs:{type:"password",label:(!s.isSet||s.reset?"New ":"")+"Password","data-test":"new-password"},model:{value:s.password,callback:function(t){s.password=t},expression:"password"}}),s._v(" "),s.reset?e("v-text-field",{attrs:{rules:[s.rules.matchPassword],type:"password",label:"Confirm Password","data-test":"confirm-password"},model:{value:s.confirmPassword,callback:function(t){s.confirmPassword=t},expression:"confirmPassword"}}):s._e(),s._v(" "),s.reset?e("v-btn",{attrs:{type:"submit",large:"",color:s.isSet?"warn":"success",disabled:!s.formValid,"data-test":"set-password"},on:{click:function(t){return t.preventDefault(),s.setPassword.apply(null,arguments)}}},[s._v("\n Set\n ")]):e("v-container",[e("v-row",[e("v-btn",{attrs:{type:"submit",large:"",color:"success",disabled:!s.formValid},on:{click:function(t){return t.preventDefault(),s.verifyPassword.apply(null,arguments)}}},[s._v("\n Login\n ")]),s._v(" "),e("v-spacer"),s._v(" "),e("v-btn",{attrs:{text:"",small:""},on:{click:s.showReset}},[s._v(" Change Password ")])],1)],1)],1)],1),s._v(" "),e("v-alert",{attrs:{type:s.alertType,dismissible:""},model:{value:s.showAlert,callback:function(t){s.showAlert=t},expression:"showAlert"}},[s._v("\n "+s._s(s.alert)+"\n ")])],1)};o._withStripped=!0;var a=e(162);const r={data:()=>({isSet:!0,password:"",confirmPassword:"",oldPassword:"",reset:!1,alert:"",alertType:"success",showAlert:!1}),computed:{options:function(){return{noAuth:!0,noScope:!0}},rules:function(){return{matchPassword:()=>this.password===this.confirmPassword||"Passwords must match"}},formValid:function(){return this.reset?this.isSet?!!this.oldPassword&&!!this.password&&this.password===this.confirmPassword:!!this.password&&this.password===this.confirmPassword:!!this.password}},created:function(){a.A.get("/openc3-api/auth/token-exists",this.options).then((s=>{this.isSet=!!s.data.result,this.isSet||(this.reset=!0)}))},methods:{showReset:function(){this.reset=!0},login:function(s){localStorage.openc3Token=s.data;const t=new URLSearchParams(window.location.search).get("redirect");t.startsWith("/tools/")?window.location=decodeURI(t):window.location="/"},verifyPassword:function(){this.showAlert=!1,a.A.post("/openc3-api/auth/verify",{data:{token:this.password},...this.options}).then((s=>{this.login(s)})).catch((s=>{this.alert="Incorrect password",this.alertType="warning",this.showAlert=!0}))},setPassword:function(){this.showAlert=!1,a.A.post("/openc3-api/auth/set",{data:{old_token:this.oldPassword,token:this.password},...this.options}).then((s=>{this.login(s)}))}}};var n=(0,e(486).A)(r,o,[],!1,null,null,null);n.options.__file="packages/openc3-tool-common/src/tools/base/components/Login.vue";const i=n.exports}}]);
1
+ "use strict";(self.webpackChunktool_base=self.webpackChunktool_base||[]).push([[51],{51:(s,t,e)=>{e.r(t),e.d(t,{default:()=>i});var o=function(){var s=this,t=s.$createElement,e=s._self._c||t;return e("v-card",[e("v-card-title",[s._v(" Login ")]),s._v(" "),e("v-card-subtitle",[s._v("\n "+s._s(s.isSet?"Enter the":"Create a")+"\n password to begin using OpenC3\n ")]),s._v(" "),e("v-card-text",[e("v-form",[s.isSet&&s.reset?e("v-text-field",{attrs:{type:"password",label:"Old Password"},model:{value:s.oldPassword,callback:function(t){s.oldPassword=t},expression:"oldPassword"}}):s._e(),s._v(" "),e("v-text-field",{attrs:{type:"password",label:(!s.isSet||s.reset?"New ":"")+"Password","data-test":"new-password"},model:{value:s.password,callback:function(t){s.password=t},expression:"password"}}),s._v(" "),s.reset?e("v-text-field",{attrs:{rules:[s.rules.matchPassword],type:"password",label:"Confirm Password","data-test":"confirm-password"},model:{value:s.confirmPassword,callback:function(t){s.confirmPassword=t},expression:"confirmPassword"}}):s._e(),s._v(" "),s.reset?e("v-btn",{attrs:{type:"submit",large:"",color:s.isSet?"warn":"success",disabled:!s.formValid,"data-test":"set-password"},on:{click:function(t){return t.preventDefault(),s.setPassword.apply(null,arguments)}}},[s._v("\n Set\n ")]):e("v-container",[e("v-row",[e("v-btn",{attrs:{type:"submit",large:"",color:"success",disabled:!s.formValid},on:{click:function(t){return t.preventDefault(),s.verifyPassword.apply(null,arguments)}}},[s._v("\n Login\n ")]),s._v(" "),e("v-spacer"),s._v(" "),e("v-btn",{attrs:{text:"",small:""},on:{click:s.showReset}},[s._v(" Change Password ")])],1)],1)],1)],1),s._v(" "),e("v-alert",{attrs:{type:s.alertType,dismissible:""},model:{value:s.showAlert,callback:function(t){s.showAlert=t},expression:"showAlert"}},[s._v("\n "+s._s(s.alert)+"\n ")])],1)};o._withStripped=!0;var a=e(162);const r={data:()=>({isSet:!0,password:"",confirmPassword:"",oldPassword:"",reset:!1,alert:"",alertType:"success",showAlert:!1}),computed:{options:function(){return{noAuth:!0,noScope:!0}},rules:function(){return{matchPassword:()=>this.password===this.confirmPassword||"Passwords must match"}},formValid:function(){return this.reset?this.isSet?!!this.oldPassword&&!!this.password&&this.password===this.confirmPassword:!!this.password&&this.password===this.confirmPassword:!!this.password}},created:function(){a.A.get("/openc3-api/auth/token-exists",this.options).then((s=>{this.isSet=!!s.data.result,this.isSet||(this.reset=!0)}))},methods:{showReset:function(){this.reset=!0},login:function(s){localStorage.openc3Token=s.data;const t=new URLSearchParams(window.location.search).get("redirect");t.startsWith("/tools/")?window.location=decodeURI(t):window.location="/"},verifyPassword:function(){this.showAlert=!1,a.A.post("/openc3-api/auth/verify",{data:{token:this.password},...this.options}).then((s=>{this.login(s)})).catch((s=>{this.alert="Incorrect password",this.alertType="warning",this.showAlert=!0}))},setPassword:function(){this.showAlert=!1,a.A.post("/openc3-api/auth/set",{data:{old_token:this.oldPassword,token:this.password},...this.options}).then((s=>{this.login(s)})).catch((s=>{this.alert=`Invalid password: ${s.response.data.message}`,this.alertType="warning",this.showAlert=!0}))}}};var n=(0,e(486).A)(r,o,[],!1,null,null,null);n.options.__file="packages/openc3-tool-common/src/tools/base/components/Login.vue";const i=n.exports}}]);
2
2
  //# sourceMappingURL=51.openc3-tool-base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"51.openc3-tool-base.js","mappings":"gIAAA,IAAIA,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eACTC,EAAKJ,E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AAAT,KAAAU,OACA,KAAA9C,QACA,KAAAC,OAAA,EACA,GAEA,EACA8C,QAAA,CACAjB,UAAA,WACA,KAAA7B,OAAA,CACA,EACA+C,MAAA,SAAAH,GACAI,aAAAC,YAAAL,EAAAT,KACA,MAAAe,EAAA,IAAAC,gBAAAC,OAAAC,SAAAC,QAAAZ,IACA,YAEAQ,EAAAK,WAAA,WAEAH,OAAAC,SAAAG,UAAAN,GAEAE,OAAAC,SAAA,GAEA,EACA3B,eAAA,WACA,KAAAM,WAAA,EACAS,EAAAA,EAAAgB,KAAA,2BACAtB,KAAA,CACAuB,MAAA,KAAA/C,aAEA,KAAA0B,UAEAM,MAAAC,IACA,KAAAG,MAAAH,EAAA,IAEAe,OAAAC,IACA,KAAA3B,MAAA,qBACA,KAAAH,UAAA,UACA,KAAAE,WAAA,IAEA,EACAT,YAAA,WACA,KAAAS,WAAA,EACAS,EAAAA,EAAAgB,KAAA,wBACAtB,KAAA,CACA0B,UAAA,KAAAvD,YACAoD,MAAA,KAAA/C,aAEA,KAAA0B,UACAM,MAAAC,IACA,KAAAG,MAAAH,EAAA,GAEA,I,IE/KIkB,GAAY,E,OAAA,GACd,EACAxE,EHqJoB,IGnJpB,EACA,KACA,KACA,MAuBFwE,EAAUzB,QAAQ0B,OAAS,kEAC3B,QAAeD,EAAiB,O","sources":["webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?085f","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?ebfd","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?dc66"],"sourcesContent":["var render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"v-card\",\n [\n _c(\"v-card-title\", [_vm._v(\" Login \")]),\n _vm._v(\" \"),\n _c(\"v-card-subtitle\", [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.isSet ? \"Enter the\" : \"Create a\") +\n \"\\n password to begin using OpenC3\\n \"\n ),\n ]),\n _vm._v(\" \"),\n _c(\n \"v-card-text\",\n [\n _c(\n \"v-form\",\n [\n _vm.isSet && _vm.reset\n ? _c(\"v-text-field\", {\n attrs: { type: \"password\", label: \"Old Password\" },\n model: {\n value: _vm.oldPassword,\n callback: function ($$v) {\n _vm.oldPassword = $$v\n },\n expression: \"oldPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"v-text-field\", {\n attrs: {\n type: \"password\",\n label: (!_vm.isSet || _vm.reset ? \"New \" : \"\") + \"Password\",\n \"data-test\": \"new-password\",\n },\n model: {\n value: _vm.password,\n callback: function ($$v) {\n _vm.password = $$v\n },\n expression: \"password\",\n },\n }),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\"v-text-field\", {\n attrs: {\n rules: [_vm.rules.matchPassword],\n type: \"password\",\n label: \"Confirm Password\",\n \"data-test\": \"confirm-password\",\n },\n model: {\n value: _vm.confirmPassword,\n callback: function ($$v) {\n _vm.confirmPassword = $$v\n },\n expression: \"confirmPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: _vm.isSet ? \"warn\" : \"success\",\n disabled: !_vm.formValid,\n \"data-test\": \"set-password\",\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.setPassword.apply(null, arguments)\n },\n },\n },\n [_vm._v(\"\\n Set\\n \")]\n )\n : _c(\n \"v-container\",\n [\n _c(\n \"v-row\",\n [\n _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: \"success\",\n disabled: !_vm.formValid,\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.verifyPassword.apply(\n null,\n arguments\n )\n },\n },\n },\n [_vm._v(\"\\n Login\\n \")]\n ),\n _vm._v(\" \"),\n _c(\"v-spacer\"),\n _vm._v(\" \"),\n _c(\n \"v-btn\",\n {\n attrs: { text: \"\", small: \"\" },\n on: { click: _vm.showReset },\n },\n [_vm._v(\" Change Password \")]\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"v-alert\",\n {\n attrs: { type: _vm.alertType, dismissible: \"\" },\n model: {\n value: _vm.showAlert,\n callback: function ($$v) {\n _vm.showAlert = $$v\n },\n expression: \"showAlert\",\n },\n },\n [_vm._v(\"\\n \" + _vm._s(_vm.alert) + \"\\n \")]\n ),\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <v-card>\n <v-card-title> Login </v-card-title>\n <v-card-subtitle>\n {{ isSet ? 'Enter the' : 'Create a' }}\n password to begin using OpenC3\n </v-card-subtitle>\n <v-card-text>\n <v-form>\n <v-text-field\n v-if=\"isSet && reset\"\n v-model=\"oldPassword\"\n type=\"password\"\n label=\"Old Password\"\n />\n <v-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"`${!isSet || reset ? 'New ' : ''}Password`\"\n data-test=\"new-password\"\n />\n <v-text-field\n v-if=\"reset\"\n v-model=\"confirmPassword\"\n :rules=\"[rules.matchPassword]\"\n type=\"password\"\n label=\"Confirm Password\"\n data-test=\"confirm-password\"\n />\n <v-btn\n v-if=\"reset\"\n type=\"submit\"\n @click.prevent=\"setPassword\"\n large\n :color=\"isSet ? 'warn' : 'success'\"\n :disabled=\"!formValid\"\n data-test=\"set-password\"\n >\n Set\n </v-btn>\n <v-container v-else>\n <v-row>\n <v-btn\n type=\"submit\"\n @click.prevent=\"verifyPassword\"\n large\n color=\"success\"\n :disabled=\"!formValid\"\n >\n Login\n </v-btn>\n <v-spacer />\n <v-btn text small @click=\"showReset\"> Change Password </v-btn>\n </v-row>\n </v-container>\n </v-form>\n </v-card-text>\n <v-alert :type=\"alertType\" v-model=\"showAlert\" dismissible>\n {{ alert }}\n </v-alert>\n </v-card>\n</template>\n\n<script>\nimport Api from '../../../services/api'\n\nexport default {\n data() {\n return {\n isSet: true,\n password: '',\n confirmPassword: '',\n oldPassword: '',\n reset: false, // setting a password for the first time, or changing to a new password\n alert: '',\n alertType: 'success',\n showAlert: false,\n }\n },\n computed: {\n options: function () {\n return {\n noAuth: true,\n noScope: true, // lol\n }\n },\n rules: function () {\n return {\n matchPassword: () =>\n this.password === this.confirmPassword || 'Passwords must match',\n }\n },\n formValid: function () {\n if (this.reset) {\n if (!this.isSet) {\n return !!this.password && this.password === this.confirmPassword\n } else {\n return (\n !!this.oldPassword &&\n !!this.password &&\n this.password === this.confirmPassword\n )\n }\n } else {\n return !!this.password\n }\n },\n },\n created: function () {\n Api.get('/openc3-api/auth/token-exists', this.options).then((response) => {\n this.isSet = !!response.data.result\n if (!this.isSet) {\n this.reset = true\n }\n })\n },\n methods: {\n showReset: function () {\n this.reset = true\n },\n login: function (response) {\n localStorage.openc3Token = response.data\n const redirect = new URLSearchParams(window.location.search).get(\n 'redirect',\n )\n if (redirect.startsWith('/tools/')) {\n // Valid relative redirect URL\n window.location = decodeURI(redirect)\n } else {\n window.location = '/'\n }\n },\n verifyPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/verify', {\n data: {\n token: this.password,\n },\n ...this.options,\n })\n .then((response) => {\n this.login(response)\n })\n .catch((error) => {\n this.alert = 'Incorrect password'\n this.alertType = 'warning'\n this.showAlert = true\n })\n },\n setPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/set', {\n data: {\n old_token: this.oldPassword,\n token: this.password,\n },\n ...this.options,\n }).then((response) => {\n this.login(response)\n })\n },\n },\n}\n</script>\n","import mod from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Login.vue?vue&type=template&id=c187c65e&\"\nimport script from \"./Login.vue?vue&type=script&lang=js&\"\nexport * from \"./Login.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../openc3-tool-base/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\n/* hot reload */\nif (module.hot) {\n var api = require(\"/openc3/plugins/openc3-tool-base/node_modules/vue-hot-reload-api/dist/index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('c187c65e')) {\n api.createRecord('c187c65e', component.options)\n } else {\n api.reload('c187c65e', component.options)\n }\n module.hot.accept(\"./Login.vue?vue&type=template&id=c187c65e&\", function () {\n api.rerender('c187c65e', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"packages/openc3-tool-common/src/tools/base/components/Login.vue\"\nexport default component.exports"],"names":["render","_vm","this","_h","$createElement","_c","_self","_v","_s","isSet","reset","attrs","type","label","model","value","oldPassword","callback","$$v","expression","_e","password","rules","matchPassword","confirmPassword","large","color","disabled","formValid","on","click","$event","preventDefault","setPassword","apply","arguments","verifyPassword","text","small","showReset","alertType","dismissible","showAlert","alert","_withStripped","data","computed","options","noAuth","noScope","created","Api","get","then","response","result","methods","login","localStorage","openc3Token","redirect","URLSearchParams","window","location","search","startsWith","decodeURI","post","token","catch","error","old_token","component","__file"],"sourceRoot":""}
1
+ {"version":3,"file":"51.openc3-tool-base.js","mappings":"gIAAA,IAAIA,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eACTC,EAAKJ,EAAIK,MAAMD,IAAMF,EACzB,OAAOE,EACL,SACA,CACEA,EAAG,eAAgB,CAACJ,EAAIM,GAAG,aAC3BN,EAAIM,GAAG,KACPF,EAAG,kBAAmB,CACpBJ,EAAIM,GACF,SACEN,EAAIO,GAAGP,EAAIQ,MAAQ,YAAc,YACjC,8CAGNR,EAAIM,GAAG,KACPF,EACE,cACA,CACEA,EACE,SACA,CACEJ,EAAIQ,OAASR,EAAIS,MACbL,EAAG,eAAgB,CACjBM,MAAO,CAAEC,KAAM,WAAYC,MAAO,gBAClCC,MAAO,CACLC,MAAOd,EAAIe,YACXC,SAAU,SAAUC,GAClBjB,EAAIe,YAAcE,CACpB,EACAC,WAAY,iBAGhBlB,EAAImB,KACRnB,EAAIM,GAAG,KACPF,EAAG,eAAgB,CACjBM,MAAO,CACLC,KAAM,WACNC,QAASZ,EAAIQ,OAASR,EAAIS,MAAQ,OAAS,IAAM,WACjD,YAAa,gBAEfI,MAAO,CACLC,MAAOd,EAAIoB,SACXJ,SAAU,SAAUC,GAClBjB,EAAIoB,SAAWH,CACjB,EACAC,WAAY,cAGhBlB,EAAIM,GAAG,KACPN,EAAIS,MACAL,EAAG,eAAgB,CACjBM,MAAO,CACLW,MAAO,CAACrB,EAAIqB,MAAMC,eAClBX,KAAM,WACNC,MAAO,mBACP,YAAa,oBAEfC,MAAO,CACLC,MAAOd,EAAIuB,gBACXP,SAAU,SAAUC,GAClBjB,EAAIuB,gBAAkBN,CACxB,EACAC,WAAY,qBAGhBlB,EAAImB,KAC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base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?085f","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?ebfd","webpack://tool-base/../packages/openc3-tool-common/src/tools/base/components/Login.vue?dc66"],"sourcesContent":["var render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _c(\n \"v-card\",\n [\n _c(\"v-card-title\", [_vm._v(\" Login \")]),\n _vm._v(\" \"),\n _c(\"v-card-subtitle\", [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.isSet ? \"Enter the\" : \"Create a\") +\n \"\\n password to begin using OpenC3\\n \"\n ),\n ]),\n _vm._v(\" \"),\n _c(\n \"v-card-text\",\n [\n _c(\n \"v-form\",\n [\n _vm.isSet && _vm.reset\n ? _c(\"v-text-field\", {\n attrs: { type: \"password\", label: \"Old Password\" },\n model: {\n value: _vm.oldPassword,\n callback: function ($$v) {\n _vm.oldPassword = $$v\n },\n expression: \"oldPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"v-text-field\", {\n attrs: {\n type: \"password\",\n label: (!_vm.isSet || _vm.reset ? \"New \" : \"\") + \"Password\",\n \"data-test\": \"new-password\",\n },\n model: {\n value: _vm.password,\n callback: function ($$v) {\n _vm.password = $$v\n },\n expression: \"password\",\n },\n }),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\"v-text-field\", {\n attrs: {\n rules: [_vm.rules.matchPassword],\n type: \"password\",\n label: \"Confirm Password\",\n \"data-test\": \"confirm-password\",\n },\n model: {\n value: _vm.confirmPassword,\n callback: function ($$v) {\n _vm.confirmPassword = $$v\n },\n expression: \"confirmPassword\",\n },\n })\n : _vm._e(),\n _vm._v(\" \"),\n _vm.reset\n ? _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: _vm.isSet ? \"warn\" : \"success\",\n disabled: !_vm.formValid,\n \"data-test\": \"set-password\",\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.setPassword.apply(null, arguments)\n },\n },\n },\n [_vm._v(\"\\n Set\\n \")]\n )\n : _c(\n \"v-container\",\n [\n _c(\n \"v-row\",\n [\n _c(\n \"v-btn\",\n {\n attrs: {\n type: \"submit\",\n large: \"\",\n color: \"success\",\n disabled: !_vm.formValid,\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.verifyPassword.apply(\n null,\n arguments\n )\n },\n },\n },\n [_vm._v(\"\\n Login\\n \")]\n ),\n _vm._v(\" \"),\n _c(\"v-spacer\"),\n _vm._v(\" \"),\n _c(\n \"v-btn\",\n {\n attrs: { text: \"\", small: \"\" },\n on: { click: _vm.showReset },\n },\n [_vm._v(\" Change Password \")]\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n ],\n 1\n ),\n _vm._v(\" \"),\n _c(\n \"v-alert\",\n {\n attrs: { type: _vm.alertType, dismissible: \"\" },\n model: {\n value: _vm.showAlert,\n callback: function ($$v) {\n _vm.showAlert = $$v\n },\n expression: \"showAlert\",\n },\n },\n [_vm._v(\"\\n \" + _vm._s(_vm.alert) + \"\\n \")]\n ),\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","<!--\n# Copyright 2022 Ball Aerospace & Technologies Corp.\n# All Rights Reserved.\n#\n# This program is free software; you can modify and/or redistribute it\n# under the terms of the GNU Affero General Public License\n# as published by the Free Software Foundation; version 3 with\n# attribution addendums as found in the LICENSE.txt\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n# GNU Affero General Public License for more details.\n\n# Modified by OpenC3, Inc.\n# All changes Copyright 2024, OpenC3, Inc.\n# All Rights Reserved\n#\n# This file may also be used under the terms of a commercial license\n# if purchased from OpenC3, Inc.\n-->\n\n<template>\n <v-card>\n <v-card-title> Login </v-card-title>\n <v-card-subtitle>\n {{ isSet ? 'Enter the' : 'Create a' }}\n password to begin using OpenC3\n </v-card-subtitle>\n <v-card-text>\n <v-form>\n <v-text-field\n v-if=\"isSet && reset\"\n v-model=\"oldPassword\"\n type=\"password\"\n label=\"Old Password\"\n />\n <v-text-field\n v-model=\"password\"\n type=\"password\"\n :label=\"`${!isSet || reset ? 'New ' : ''}Password`\"\n data-test=\"new-password\"\n />\n <v-text-field\n v-if=\"reset\"\n v-model=\"confirmPassword\"\n :rules=\"[rules.matchPassword]\"\n type=\"password\"\n label=\"Confirm Password\"\n data-test=\"confirm-password\"\n />\n <v-btn\n v-if=\"reset\"\n type=\"submit\"\n @click.prevent=\"setPassword\"\n large\n :color=\"isSet ? 'warn' : 'success'\"\n :disabled=\"!formValid\"\n data-test=\"set-password\"\n >\n Set\n </v-btn>\n <v-container v-else>\n <v-row>\n <v-btn\n type=\"submit\"\n @click.prevent=\"verifyPassword\"\n large\n color=\"success\"\n :disabled=\"!formValid\"\n >\n Login\n </v-btn>\n <v-spacer />\n <v-btn text small @click=\"showReset\"> Change Password </v-btn>\n </v-row>\n </v-container>\n </v-form>\n </v-card-text>\n <v-alert :type=\"alertType\" v-model=\"showAlert\" dismissible>\n {{ alert }}\n </v-alert>\n </v-card>\n</template>\n\n<script>\nimport Api from '../../../services/api'\n\nexport default {\n data() {\n return {\n isSet: true,\n password: '',\n confirmPassword: '',\n oldPassword: '',\n reset: false, // setting a password for the first time, or changing to a new password\n alert: '',\n alertType: 'success',\n showAlert: false,\n }\n },\n computed: {\n options: function () {\n return {\n noAuth: true,\n noScope: true, // lol\n }\n },\n rules: function () {\n return {\n matchPassword: () =>\n this.password === this.confirmPassword || 'Passwords must match',\n }\n },\n formValid: function () {\n if (this.reset) {\n if (!this.isSet) {\n return !!this.password && this.password === this.confirmPassword\n } else {\n return (\n !!this.oldPassword &&\n !!this.password &&\n this.password === this.confirmPassword\n )\n }\n } else {\n return !!this.password\n }\n },\n },\n created: function () {\n Api.get('/openc3-api/auth/token-exists', this.options).then((response) => {\n this.isSet = !!response.data.result\n if (!this.isSet) {\n this.reset = true\n }\n })\n },\n methods: {\n showReset: function () {\n this.reset = true\n },\n login: function (response) {\n localStorage.openc3Token = response.data\n const redirect = new URLSearchParams(window.location.search).get(\n 'redirect',\n )\n if (redirect.startsWith('/tools/')) {\n // Valid relative redirect URL\n window.location = decodeURI(redirect)\n } else {\n window.location = '/'\n }\n },\n verifyPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/verify', {\n data: {\n token: this.password,\n },\n ...this.options,\n })\n .then((response) => {\n this.login(response)\n })\n .catch((error) => {\n this.alert = 'Incorrect password'\n this.alertType = 'warning'\n this.showAlert = true\n })\n },\n setPassword: function () {\n this.showAlert = false\n Api.post('/openc3-api/auth/set', {\n data: {\n old_token: this.oldPassword,\n token: this.password,\n },\n ...this.options,\n })\n .then((response) => {\n this.login(response)\n })\n .catch((error) => {\n this.alert = `Invalid password: ${error.response.data.message}`\n this.alertType = 'warning'\n this.showAlert = true\n })\n },\n },\n}\n</script>\n","import mod from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../openc3-tool-base/node_modules/babel-loader/lib/index.js!../../../../../../openc3-tool-base/node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Login.vue?vue&type=template&id=c187c65e&\"\nimport script from \"./Login.vue?vue&type=script&lang=js&\"\nexport * from \"./Login.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../openc3-tool-base/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\n/* hot reload */\nif (module.hot) {\n var api = require(\"/openc3/plugins/openc3-tool-base/node_modules/vue-hot-reload-api/dist/index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('c187c65e')) {\n api.createRecord('c187c65e', component.options)\n } else {\n api.reload('c187c65e', component.options)\n }\n module.hot.accept(\"./Login.vue?vue&type=template&id=c187c65e&\", function () {\n api.rerender('c187c65e', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"packages/openc3-tool-common/src/tools/base/components/Login.vue\"\nexport default component.exports"],"names":["render","_vm","this","_h","$createElement","_c","_self","_v","_s","isSet","reset","attrs","type","label","model","value","oldPassword","callback","$$v","expression","_e","password","rules","matchPassword","confirmPassword","large","color","disabled","formValid","on","click","$event","preventDefault","setPassword","apply","arguments","verifyPassword","text","small","showReset","alertType","dismissible","showAlert","alert","_withStripped","data","computed","options","noAuth","noScope","created","Api","get","then","response","result","methods","login","localStorage","openc3Token","redirect","URLSearchParams","window","location","search","startsWith","decodeURI","post","token","catch","error","old_token","message","component","__file"],"sourceRoot":""}