File: /home/nepi/public_html/public/admin/js/chunk-0b3e4f54.7b4ee83d.js.map
{"version":3,"sources":["webpack:///./src/interfaces/2fa-secret/input.vue?3e97","webpack:///src/interfaces/2fa-secret/input.vue","webpack:///./src/interfaces/2fa-secret/input.vue?ac8e","webpack:///./src/interfaces/2fa-secret/input.vue","webpack:///./src/interfaces/2fa-secret/input.vue?746d","webpack:///./node_modules/@directus/extension-toolkit/mixins/interface.js"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","attrs","_v","_s","$t","_e","totpUrl","width","value","loading","on","getToken","removeValue","staticRenderFns","component","module","exports","props","id","type","String","required","name","default","length","Number","readonly","Boolean","collection","primaryKey","options","Object","newItem","relation","fields","values","val","includes"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,uBAAuB,CAAEN,EAAc,WAAEI,EAAG,WAAW,CAACE,YAAY,UAAUC,MAAM,CAAC,KAAO,SAAS,CAACP,EAAIQ,GAAG,IAAIR,EAAIS,GAAGT,EAAIU,GAAG,0BAA0B,OAAOV,EAAIW,KAAMX,EAAc,WAAEI,EAAG,UAAU,CAACE,YAAY,KAAKC,MAAM,CAAC,MAAQP,EAAIY,QAAQ,QAAU,CAAEC,MAAO,QAASb,EAAIW,KAAOX,EAAIc,MAAuGd,EAAIW,KAApGP,EAAG,WAAW,CAACG,MAAM,CAAC,QAAUP,EAAIe,SAASC,GAAG,CAAC,MAAQhB,EAAIiB,WAAW,CAACjB,EAAIQ,GAAG,gBAA0BR,EAAS,MAAEI,EAAG,WAAW,CAACY,GAAG,CAAC,MAAQhB,EAAIkB,cAAc,CAAClB,EAAIQ,GAAG,iBAAiBR,EAAIW,MAAM,IAC7lBQ,EAAkB,G,gECetB,GACA,yBACA,YACA,YAEA,aACA,KANA,WAOA,OACA,WACA,WACA,kBAGA,UACA,QADA,WAEA,qIAGA,SACA,SADA,WACA,WACA,gBAEA,cACA,yBACA,iDACA,kBACA,mBACA,kBAEA,mBACA,aAEA,4CAEA,YAhBA,WAiBA,yBACA,wBCpD8V,I,wBCQ1VC,EAAY,eACd,EACArB,EACAoB,GACA,EACA,KACA,WACA,MAIa,aAAAC,E,6CCnBf,yBAAsf,EAAG,G,qBCAzfC,EAAOC,QAAU,CACfC,MAAO,CAILC,GAAI,CACFC,KAAMC,OACNC,UAAU,GAGZC,KAAM,CACJH,KAAMC,OACNC,UAAU,GAIZb,MAAO,CACLW,KAAM,KACNI,QAAS,MAGXJ,KAAM,CACJA,KAAMC,OACNC,UAAU,GAGZG,OAAQ,CACNL,KAAM,CAACC,OAAQK,QACfF,QAAS,MAGXG,SAAU,CACRP,KAAMQ,QACNJ,SAAS,GAGXK,WAAY,CACVT,KAAMC,OACNG,QAAS,MAGXM,WAAY,CACVV,KAAM,CAACM,OAAQL,QACfG,QAAS,MAGXF,SAAU,CACRF,KAAMQ,QACNJ,SAAS,GAGXO,QAAS,CACPX,KAAMY,OACNR,QAAS,KAAM,KAGjBS,QAAS,CACPb,KAAMQ,QACNJ,SAAS,GAIXU,SAAU,CACRd,KAAMY,OACNR,QAAS,MAGXW,OAAQ,CACNf,KAAMY,OACNR,QAAS,MAIXY,OAAQ,CACNhB,KAAMY,OACNR,QAAS,MAEXhB,MAAO,CACLY,KAAMC,OACNG,QAAS,KACT,UAAUa,GACR,MAAO,CACL,OACA,YACA,aACA,OACA,QACAC,SAASD,Q","file":"js/chunk-0b3e4f54.7b4ee83d.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"interface-2fa-value\"},[(_vm.tfa_secret)?_c('v-notice',{staticClass:\"qr-info\",attrs:{\"icon\":\"info\"}},[_vm._v(\" \"+_vm._s(_vm.$t('scan_in_authenticator'))+\" \")]):_vm._e(),(_vm.tfa_secret)?_c('qr-code',{staticClass:\"qr\",attrs:{\"value\":_vm.totpUrl,\"options\":{ width: 200 }}}):_vm._e(),(!_vm.value)?_c('v-button',{attrs:{\"loading\":_vm.loading},on:{\"click\":_vm.getToken}},[_vm._v(\"Enable 2FA\")]):_vm._e(),(_vm.value)?_c('v-button',{on:{\"click\":_vm.removeValue}},[_vm._v(\"Disable 2FA\")]):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n\t<div class=\"interface-2fa-value\">\n\t\t<v-notice v-if=\"tfa_secret\" icon=\"info\" class=\"qr-info\">\n\t\t\t{{ $t('scan_in_authenticator') }}\n\t\t</v-notice>\n\t\t<qr-code v-if=\"tfa_secret\" class=\"qr\" :value=\"totpUrl\" :options=\"{ width: 200 }\" />\n\n\t\t<v-button v-if=\"!value\" :loading=\"loading\" @click=\"getToken\">Enable 2FA</v-button>\n\t\t<v-button v-if=\"value\" @click=\"removeValue\">Disable 2FA</v-button>\n\t</div>\n</template>\n\n<script>\nimport mixin from '@directus/extension-toolkit/mixins/interface';\nimport QrCode from '@chenfengyuan/vue-qrcode';\n\nexport default {\n\tname: 'Interface2faValue',\n\tcomponents: {\n\t\tQrCode\n\t},\n\tmixins: [mixin],\n\tdata() {\n\t\treturn {\n\t\t\tloading: false,\n\t\t\terror: null,\n\t\t\ttfa_secret: null\n\t\t};\n\t},\n\tcomputed: {\n\t\ttotpUrl() {\n\t\t\treturn `otpauth://totp/Directus:${this.$store.state.currentUser.email}?secret=${this.tfa_secret}&issuer=Directus`;\n\t\t}\n\t},\n\tmethods: {\n\t\tgetToken() {\n\t\t\tthis.loading = true;\n\n\t\t\tthis.$api.api\n\t\t\t\t.get('/utils/2fa_secret')\n\t\t\t\t.then(res => res.data['2fa_secret'])\n\t\t\t\t.then(token => {\n\t\t\t\t\tthis.$emit('input', token);\n\t\t\t\t\tthis.tfa_secret = token;\n\t\t\t\t})\n\t\t\t\t.catch(error => {\n\t\t\t\t\tthis.error = error;\n\t\t\t\t})\n\t\t\t\t.finally(() => (this.loading = false));\n\t\t},\n\t\tremoveValue() {\n\t\t\tthis.$emit('input', null);\n\t\t\tthis.tfa_secret = null;\n\t\t}\n\t}\n};\n</script>\n\n<style scoped>\n.qr {\n\tborder: var(--input-border-width) solid var(--blue-grey-50);\n\tborder-radius: var(--border-radius);\n\tmargin-bottom: 16px;\n}\n\n.qr-info {\n\tmargin-bottom: 16px;\n}\n</style>\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./input.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./input.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./input.vue?vue&type=template&id=64ffdb20&scoped=true&\"\nimport script from \"./input.vue?vue&type=script&lang=js&\"\nexport * from \"./input.vue?vue&type=script&lang=js&\"\nimport style0 from \"./input.vue?vue&type=style&index=0&id=64ffdb20&scoped=true&lang=css&\"\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 \"64ffdb20\",\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./input.vue?vue&type=style&index=0&id=64ffdb20&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./input.vue?vue&type=style&index=0&id=64ffdb20&scoped=true&lang=css&\"","module.exports = {\n props: {\n // Unique id for this interface. Should be added to the lower level \n // HTML input element if applicable. This ID will be used in the label's\n // `for` attribute\n id: {\n type: String,\n required: true\n },\n // Name of the field\n name: {\n type: String,\n required: true\n },\n // The current value. This can either be the default value, the saved database\n // value or the current state after the user made an edit\n value: {\n type: null,\n default: null\n },\n // Type of the field, eg `string`, `hash`, or `array`\n type: {\n type: String,\n required: true\n },\n // Max length\n length: {\n type: [String, Number],\n default: null\n },\n // If the field is readonly or not\n readonly: {\n type: Boolean,\n default: false\n },\n // Name of the collection\n collection: {\n type: String,\n default: null\n },\n // Primary key of the item you're editing in this context\n primaryKey: {\n type: [Number, String],\n default: null\n },\n // If the field is required or not\n required: {\n type: Boolean,\n default: false\n },\n // Field options. A json object based on the interface's meta.json file\n options: {\n type: Object,\n default: () => ({})\n },\n // If the item that's currently being edited is new\n newItem: {\n type: Boolean,\n default: false\n },\n // The relation of the current field. Will contain information on the related\n // collection and field(s)\n relation: {\n type: Object,\n default: null\n },\n // The other fields in the current edit page\n fields: {\n type: Object,\n default: null\n },\n // The values of the other fields on the edit page. Can be used for things like\n // automatically generating a slug based on another field\n values: {\n type: Object,\n default: null\n },\n width: {\n type: String,\n default: null,\n validator(val) {\n return [\n 'half',\n 'half-left',\n 'half-right',\n 'full',\n 'fill'\n ].includes(val);\n }\n }\n }\n};\n"],"sourceRoot":""}