@ozdao/prometheus-framework 0.2.126 → 0.2.127
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +61 -2
- package/dist/auth.server.mjs +61 -2
- package/dist/gallery.server.js +55 -3
- package/dist/gallery.server.mjs +55 -3
- package/dist/main-CF35oB7q.js +92 -0
- package/dist/main-CmL_j3wv.mjs +14223 -0
- package/dist/organizations.server.js +112 -184
- package/dist/organizations.server.mjs +112 -184
- package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +1 -94
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +94 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +1 -84
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +84 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +1 -77
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +77 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +1 -45
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +45 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +57 -50
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +68 -62
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/gallery/gallery.client.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/gallery.client.js +4 -4
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +14 -14
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +116 -94
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/store/departments.js +9 -4
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-BDaOF322.js +1 -0
- package/dist/web-DtWmpLE-.mjs +54 -0
- package/package.json +1 -1
- package/src/modules/auth/controllers/auth.controller.js +68 -2
- package/src/modules/auth/routes/auth.routes.js +8 -1
- package/src/modules/auth/store/auth.js +21 -9
- package/src/modules/backoffice/components/pages/Dashboard.vue +6 -0
- package/src/modules/gallery/gallery.client.js +1 -1
- package/src/modules/gallery/routes/gallery.routes.js +7 -3
- package/src/modules/globals/mixins/mixins.js +17 -0
- package/src/modules/middlewares/server/verifyAccesses.js +100 -23
- package/src/modules/organizations/components/blocks/CardDepartment.vue +1 -1
- package/src/modules/organizations/components/pages/DepartmentEdit.vue +24 -2
- package/src/modules/organizations/components/pages/Members.vue +1 -1
- package/src/modules/organizations/models/department.model.js +42 -2
- package/src/modules/organizations/routes/departments.routes.js +1 -8
- package/src/modules/organizations/store/departments.js +5 -0
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Field/Field.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");const l=require("../../../../components/Field/Field.vue2.cjs"),f=require("../../../../components/Button/Button.vue2.cjs"),i=require("vue-router"),h=require("vue-i18n"),t=require("../../store/auth.cjs"),d=require("../../../middlewares/client/inputs.validation.cjs"),w=require("../../localization/EnterPassword.json.cjs");require("./EnterPassword.vue2.cjs");const _={class:"t-left pd-medium"},y={class:"mn-b-small"},g={key:0,class:"mn-b-semi t-transp"},b={key:1,class:"mn-b-semi t-transp"},k={class:"mn-b-semi radius-small o-hidden"},q={key:2,class:"p-medium t-semi mn-b-semi"},B=e.createElementVNode("a",{class:"t-second",href:"/legal/eula",target:"_blank",rel:"noopener noreferrer"},"End User License Agreement (EULA)",-1),E={key:0},P={key:1},v={__name:"EnterPassword",setup(S){const n=e.ref(null),{t:s}=h.useI18n({useScope:"global",...w.default}),r=i.useRoute(),u=i.useRouter();e.ref("phone");async function c(){try{await d.validateInputs(n,d.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}r.query.method==="reset-password"&&await t.actions.updatePassword(t.state.user,r.query.type),r.query.method!=="reset-password"&&await t.actions.signup(t.state.user,r.query.type)}function p(){u.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(m,o)=>(e.openBlock(),e.createElementBlock("section",_,[e.createElementVNode("h3",y,e.toDisplayString(e.unref(s)("almostDone")),1),e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("p",g,e.toDisplayString(e.unref(s)("newPasswordPrompt")),1)):(e.openBlock(),e.createElementBlock("p",b,e.toDisplayString(e.unref(s)("registrationPasswordPrompt")),1)),e.createElementVNode("div",k,[e.createVNode(l.default,{field:t.state.user.password,"onUpdate:field":o[0]||(o[0]=a=>t.state.user.password=a),type:"password",validation:n.value,placeholder:e.unref(s)("passwordPlaceholder"),class:"bg-light pd-small radius-small mn-b-thin"},null,8,["field","validation","placeholder"]),e.createVNode(l.default,{field:t.state.user.passwordRepeat,"onUpdate:field":o[1]||(o[1]=a=>t.state.user.passwordRepeat=a),type:"password",placeholder:e.unref(s)("repeatPasswordPlaceholder"),class:"bg-light pd-small radius-small mn-b-thin"},null,8,["field","placeholder"])]),e.unref(r).query.method!=="reset-password"?(e.openBlock(),e.createElementBlock("div",q,[e.createTextVNode(" By registering, you agree to our "),B])):e.createCommentVNode("",!0),e.createVNode(f.default,{submit:c,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[e.unref(r).query.method==="reset-password"?(e.openBlock(),e.createElementBlock("span",E,e.toDisplayString(e.unref(s)("changePasswordBtn")),1)):(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(e.unref(s)("registerBtn")),1))]),_:1})]))}};exports.default=v;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ref as u, openBlock as o, createElementBlock as a, createElementVNode as p, toDisplayString as i, unref as e, createVNode as l, createTextVNode as g, createCommentVNode as b, withCtx as P } from "vue";
|
2
2
|
import "../../../../components/Tab/Tab.vue.js";
|
3
|
-
import c from "../../../../components/Field/Field.
|
4
|
-
import k from "../../../../components/Button/Button.
|
3
|
+
import c from "../../../../components/Field/Field.vue2.js";
|
4
|
+
import k from "../../../../components/Button/Button.vue2.js";
|
5
5
|
import { useRoute as q, useRouter as v } from "vue-router";
|
6
6
|
import { useI18n as E } from "vue-i18n";
|
7
7
|
import { state as s, actions as h } from "../../store/auth.js";
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");const d=require("../../../../components/Field/Field.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Tab/Tab.vue.cjs");const d=require("../../../../components/Field/Field.vue2.cjs"),h=require("../../../../components/Button/Button.vue2.cjs"),u=require("vue-router"),t=require("../../store/auth.cjs"),w=require("../../../organizations/store/invites.cjs"),c=require("../../../middlewares/client/inputs.validation.cjs");require("./Invite.vue2.cjs");const f={class:"t-left pd-medium"},v=e.createElementVNode("h3",{class:"mn-b-small"},"You have been invited to the organization",-1),b=e.createElementVNode("p",{class:"mn-b-semi t-transp"},"Please provide a password to complete the registration.",-1),q={class:"mn-b-semi radius-small o-hidden"},y=e.createElementVNode("span",null,"Join",-1),g={__name:"Invite",async setup(V){let i,n;const l=e.ref(null),a=u.useRoute(),p=u.useRouter();[i,n]=e.withAsyncContext(()=>w.actions.readOne(a.query.inviteCode)),await i,n();async function m(){try{await c.validateInputs(l,c.validatePassword,t.state.user.password,"Некорректный пароль")}catch{throw new Error}try{await t.actions.signup(t.state.user,a.query.type,a.query.inviteCode)}catch(r){console.log(r)}}function _(){p.push({name:"User Profile",params:{_id:t.state.user._id},query:{afterAuth:"true"}})}return(r,s)=>(e.openBlock(),e.createElementBlock("section",f,[v,b,e.createElementVNode("div",q,[e.createVNode(d.default,{field:t.state.user.password,"onUpdate:field":s[0]||(s[0]=o=>t.state.user.password=o),type:"password",validation:l.value,label:"Password",placeholder:"******",class:"mn-b-thin bg-light pd-medium radius-small"},null,8,["field","validation"]),e.createVNode(d.default,{field:t.state.user.passwordRepeat,"onUpdate:field":s[1]||(s[1]=o=>t.state.user.passwordRepeat=o),type:"password",label:"Repeat Password",placeholder:"******",class:"bg-light pd-medium radius-small"},null,8,["field"])]),e.createVNode(h.default,{submit:m,callback:_,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[y]),_:1})]))}};exports.default=g;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ref as f, withAsyncContext as _, openBlock as w, createElementBlock as h, createElementVNode as s, createVNode as i, withCtx as b } from "vue";
|
2
2
|
import "../../../../components/Tab/Tab.vue.js";
|
3
|
-
import p from "../../../../components/Field/Field.
|
4
|
-
import v from "../../../../components/Button/Button.
|
3
|
+
import p from "../../../../components/Field/Field.vue2.js";
|
4
|
+
import v from "../../../../components/Button/Button.vue2.js";
|
5
5
|
import { useRoute as y, useRouter as g } from "vue-router";
|
6
6
|
import { state as e, actions as P } from "../../store/auth.js";
|
7
7
|
import { actions as R } from "../../../organizations/store/invites.js";
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),v=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),_=require("../../../../components/Button/Button.vue2.cjs"),u=require("vue-router"),b=require("vue-i18n"),g=require("../../localization/ResetPassword.json.cjs"),s=require("../../store/auth.cjs");require("../../store/twofa.cjs");const n=require("../../../middlewares/client/inputs.validation.cjs");require("./ResetPassword.vue2.cjs");const w={class:"t-left pd-medium"},V={class:"mn-b-small"},N={class:"mn-b-small t-transp"},q={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},y={class:"pos-relative"},E={key:0,class:"mn-b-semi radius-small o-hidden"},C={class:"mn-b-small t-transp"},S={key:0,class:"mn-b-semi radius-small o-hidden"},k={class:"mn-b-small t-transp"},P={__name:"ResetPassword",setup(I){const{t}=b.useI18n({useScope:"global",...g.default}),i=e.ref(null),d=e.ref(null);u.useRoute();const c=u.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await n.validateInputs(i,n.validatePhone,s.state.user.phone,"Некорректный телефон"),a.value==="email"&&await n.validateInputs(d,n.validateEmail,s.state.user.email,"Некорректный email")}catch{throw new Error}try{await s.actions.resetPassword(s.state.user,a.value,"reset-password")}catch(r){throw console.log(r),new Error}}function p(){c.push({name:"Enter Code",query:{type:a.value,method:"reset-password"}})}return(r,o)=>(e.openBlock(),e.createElementBlock("section",w,[e.createElementVNode("h3",V,e.toDisplayString(e.unref(t)("forgotPasswordTitle")),1),e.createElementVNode("p",N,e.toDisplayString(e.unref(t)("instructions")),1),e.createElementVNode("div",q,[e.createVNode(h.default,{selected:a.value,"onUpdate:selected":o[0]||(o[0]=l=>a.value=l),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",y,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="phone"?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("p",C,e.toDisplayString(e.unref(t)("smsInfo")),1),e.createVNode(v.default,{onChange:o[1]||(o[1]=l=>s.state.user.phone=l),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:i.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-light pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[a.value==="email"?(e.openBlock(),e.createElementBlock("div",S,[e.createElementVNode("p",k,e.toDisplayString(e.unref(t)("emailInfo")),1),e.createVNode(f.default,{field:s.state.user.email,"onUpdate:field":o[2]||(o[2]=l=>s.state.user.email=l),placeholder:e.unref(t)("emailPlaceholder"),validation:d.value,class:"bg-light pd-medium radius-small"},null,8,["field","placeholder","validation"])])):e.createCommentVNode("",!0)]),_:1})]),e.createVNode(_.default,{submit:m,callback:p,class:"mn-b-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1})]))}};exports.default=P;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { ref as m, openBlock as u, createElementBlock as p, createElementVNode as a, toDisplayString as r, unref as t, createVNode as l, Transition as _, withCtx as c, createCommentVNode as v, createTextVNode as C } from "vue";
|
2
2
|
import P from "../../../../components/Tab/Tab.vue2.js";
|
3
|
-
import E from "../../../../components/Field/Field.
|
3
|
+
import E from "../../../../components/Field/Field.vue2.js";
|
4
4
|
import I from "../../../../components/FieldPhone/FieldPhone.vue.js";
|
5
|
-
import V from "../../../../components/Button/Button.
|
5
|
+
import V from "../../../../components/Button/Button.vue2.js";
|
6
6
|
import { useRoute as k, useRouter as x } from "vue-router";
|
7
7
|
import { useI18n as N } from "vue-i18n";
|
8
8
|
import S from "../../localization/ResetPassword.json.js";
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Field/Field.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),b=require("../../../../components/Tab/Tab.vue2.cjs"),m=require("../../../../components/Field/Field.vue2.cjs"),w=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),V=require("../../../../components/Button/Button.vue2.cjs"),h=require("vue-router"),N=require("vue-i18n"),y=require("../../localization/SignIn.json.cjs"),s=require("../../store/auth.cjs"),r=require("../../../middlewares/client/inputs.validation.cjs");require("./SignIn.vue2.cjs");const S={class:""},q=e.createElementVNode("img",{src:"/logo/logo.svg",class:"i-extra radius-small mn-b-small"},null,-1),E={class:"mn-b-medium"},x=e.createElementVNode("br",null,null,-1),C={class:"t-semi"},D={class:"mn-b-big"},P={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},T={class:"pos-relative"},I={class:"mn-b-thin radius-small"},U={class:"mn-b-thin radius-small o-hidden"},k={class:"w-100 mn-b-big"},O={__name:"SignIn",setup(j){const d=e.ref(null),f=e.ref(null),u=e.ref(null),c=h.useRoute(),p=h.useRouter(),{t:l}=N.useI18n({useScope:"global",...y.default}),n=e.ref("phone"),v=o=>new Promise((a,i)=>{const t=document.createElement("script");t.type="text/javascript",t.src=o,t.onload=a,t.onerror=i,document.head.appendChild(t)});e.onMounted(async()=>{await v("https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js")});async function _(){try{n.value==="phone"&&await r.validateInputs(d,r.validatePhone,s.state.user.phone,"Некорректный телефон"),n.value==="email"&&await r.validateInputs(u,r.validateEmail,s.state.user.email,"Некорректный email")}catch{throw new Error}const o={...s.state.user};await s.actions.login(o,n.value)}function g(){c.query.returnUrl?p.push({path:c.query.returnUrl,query:{afterAuth:"true"}}):p.push({name:"User Profile",params:{_id:s.state.user._id},query:{afterAuth:"true"}})}return(o,a)=>{const i=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",S,[q,e.createElementVNode("h3",E,[e.createTextVNode(e.toDisplayString(e.unref(l)("title"))+" ",1),x,e.createElementVNode("span",C,e.toDisplayString(e.unref(l)("subtitle")),1)]),e.createElementVNode("p",D,[e.createVNode(i,{to:{name:"Sign Up"},class:"underline t-second"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signup")),1)]),_:1})]),e.createElementVNode("div",P,[e.createVNode(b.default,{selected:n.value,"onUpdate:selected":a[0]||(a[0]=t=>n.value=t),tabs:[{name:e.unref(l)("phone"),value:"phone"},{name:e.unref(l)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",T,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",I,[e.createVNode(w.default,{onChange:a[1]||(a[1]=t=>s.state.user.phone=t),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validCharactersOnly:!0,validation:d.value,mode:"national",inputOptions:{placeholder:e.unref(l)("phonePlaceholder"),type:"tel"},class:"bg-light pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])],512),[[e.vShow,n.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",U,[e.createVNode(m.default,{field:s.state.user.email,"onUpdate:field":a[2]||(a[2]=t=>s.state.user.email=t),placeholder:e.unref(l)("emailPlaceholder"),validation:u.value,class:"bg-light pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,n.value==="email"]])]),_:1})]),e.createVNode(m.default,{field:s.state.user.password,"onUpdate:field":a[3]||(a[3]=t=>s.state.user.password=t),type:"password",validation:f.value,placeholder:e.unref(l)("passwordPlaceholder"),class:"bg-light pd-medium radius-small mn-b-semi"},null,8,["field","validation","placeholder"]),e.createElementVNode("div",k,[e.createVNode(i,{to:"/auth/reset-password",class:"underline d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("forgotPassword")),1)]),_:1})]),e.createVNode(V.default,{submit:_,callback:g,class:"w-100 bg-main mn-b-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("signin")),1)]),_:1})])}}};exports.default=O;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { ref as m, onMounted as k, resolveComponent as E, openBlock as V, createElementBlock as I, createElementVNode as s, createTextVNode as c, toDisplayString as r, unref as a, createVNode as o, withCtx as d, Transition as b, withDirectives as g, vShow as w } from "vue";
|
2
2
|
import q from "../../../../components/Tab/Tab.vue2.js";
|
3
|
-
import y from "../../../../components/Field/Field.
|
3
|
+
import y from "../../../../components/Field/Field.vue2.js";
|
4
4
|
import D from "../../../../components/FieldPhone/FieldPhone.vue.js";
|
5
|
-
import O from "../../../../components/Button/Button.
|
5
|
+
import O from "../../../../components/Button/Button.vue2.js";
|
6
6
|
import { useRoute as j, useRouter as A } from "vue-router";
|
7
7
|
import { useI18n as F } from "vue-i18n";
|
8
8
|
import N from "../../localization/SignIn.json.js";
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../../../../components/Tab/Tab.vue2.cjs"),f=require("../../../../components/Field/Field.vue2.cjs"),_=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),b=require("../../../../components/Button/Button.vue2.cjs"),d=require("vue-router"),g=require("vue-i18n"),w=require("../../localization/SignUp.json.cjs"),l=require("../../store/auth.cjs"),N=require("../../store/twofa.cjs"),i=require("../../../middlewares/client/inputs.validation.cjs");require("./SignUp.vue2.cjs");const V={class:"t-left pd-medium"},S={class:"mn-b-small"},E={class:"mn-b-small p-small uppercase t-semi bg-light radius-big o-hidden"},q={class:"pos-relative"},C={class:"mn-b-semi radius-small"},y={class:"mn-b-small t-transp"},D={class:"mn-b-semi radius-small o-hidden"},x={class:"mn-b-small t-transp"},T={class:"w-100"},k={__name:"SignUp",setup(I){const{t}=g.useI18n({useScope:"global",...w.default}),s=e.ref(null),r=e.ref(null);d.useRoute();const c=d.useRouter(),a=e.ref("phone");async function m(){try{a.value==="phone"&&await i.validateInputs(s,i.validatePhone,l.state.user.phone,"Некорректный телефон"),a.value==="email"&&await i.validateInputs(r,i.validateEmail,l.state.user.email,"Некорректный email")}catch{throw new Error}try{await N.sendCode(l.state.user,"signup",a.value)}catch{throw new Error}}function p(){c.push({name:"Enter Code"})}return(u,n)=>{const h=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",V,[e.createElementVNode("h3",S,e.toDisplayString(e.unref(t)("title")),1),e.createElementVNode("div",E,[e.createVNode(v.default,{selected:a.value,"onUpdate:selected":n[0]||(n[0]=o=>a.value=o),tabs:[{name:e.unref(t)("phone"),value:"phone"},{name:e.unref(t)("email"),value:"email"}]},null,8,["selected","tabs"])]),e.createElementVNode("div",q,[e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",C,[e.createElementVNode("p",y,e.toDisplayString(e.unref(t)("smsNotice")),1),e.createVNode(_.default,{onChange:n[1]||(n[1]=o=>l.state.user.phone=o),dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},validation:s.value,mode:"national",inputOptions:{placeholder:e.unref(t)("phonePlaceholder")},class:"bg-light pd-small radius-small mn-b-thin"},null,8,["validation","inputOptions"])],512),[[e.vShow,a.value==="phone"]])]),_:1}),e.createVNode(e.Transition,{name:"slide-fade"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",D,[e.createElementVNode("p",x,e.toDisplayString(e.unref(t)("emailNotice")),1),e.createVNode(f.default,{field:l.state.user.email,"onUpdate:field":n[2]||(n[2]=o=>l.state.user.email=o),placeholder:e.unref(t)("emailPlaceholder"),validation:r.value,class:"bg-light pd-medium radius-small"},null,8,["field","placeholder","validation"])],512),[[e.vShow,a.value==="email"]])]),_:1})]),e.createVNode(b.default,{submit:m,callback:p,class:"w-100 bg-main mn-b-big"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("sendCode")),1)]),_:1}),e.createElementVNode("div",T,[e.createVNode(h,{to:"/auth/signin",class:"underline mn-b-medium d-block t-blue"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("haveAccount")),1)]),_:1})])])}}};exports.default=k;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { ref as d, resolveComponent as E, openBlock as S, createElementBlock as x, createElementVNode as o, toDisplayString as r, unref as t, createVNode as a, Transition as h, withCtx as m, withDirectives as f, vShow as _, createTextVNode as v } from "vue";
|
2
2
|
import N from "../../../../components/Tab/Tab.vue2.js";
|
3
|
-
import V from "../../../../components/Field/Field.
|
3
|
+
import V from "../../../../components/Field/Field.vue2.js";
|
4
4
|
import y from "../../../../components/FieldPhone/FieldPhone.vue.js";
|
5
|
-
import D from "../../../../components/Button/Button.
|
5
|
+
import D from "../../../../components/Button/Button.vue2.js";
|
6
6
|
import { useRoute as I, useRouter as P } from "vue-router";
|
7
7
|
import { useI18n as F } from "vue-i18n";
|
8
8
|
import O from "../../localization/SignUp.json.js";
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../../../../node_modules/axios/lib/axios.cjs"),l=require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs"),w=require("../../../../node_modules/@capacitor/preferences/dist/esm/index.cjs"),f=require("vue"),c=require("../../globals/store/globals.cjs"),h=require("./twofa.cjs"),u=d.default.create({baseURL:process.env.API_URL,withCredentials:!0}),a=f.reactive({user:{_id:void 0,username:"",email:"",phone:"",password:"",passwordRepeat:""},access:{roles:null,token:null,status:!1},accesses:[]});async function k(){try{const e=await m("user");if(e){const{_id:t,email:s,phone:n,roles:o,accessToken:r}=e;d.default.interceptors.request.use(i=>(i.headers["x-access-token"]=r,i),i=>Promise.reject(i));const O=(await d.default.get("/api/auth/check-accesses")).data;Object.assign(a.user,{_id:t,email:s,phone:n}),Object.assign(a.access,{token:r,roles:o,status:!!r}),a.accesses=O}}catch(e){console.error("Error initializing app:",e),g("user"),a.accesses=[]}}k();const P={async login(e,t){try{const s=await u.post("/api/auth/signin",{...e,type:t});return p("user",s.data),Object.assign(a.user,{...s.data}),Object.assign(a.access,{token:s.data.accessToken,status:!0,roles:s.data.roles}),s.data}catch(s){return Object.assign(a.access,{token:null,status:!1,roles:null}),c.setError(s),Promise.reject(s)}},async signup(e,t,s){const{password:n,passwordRepeat:o}=a.user;if(console.log(n),console.log(o),n!==o){const r={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(r),new Error(r.response.status)}try{const r=await u.post("/api/auth/signup",{...e,type:t,inviteCode:s});return console.log(r),r.data.accessToken&&p("user",r.data),Object.assign(a.user,{...r.data}),Object.assign(a.access,{token:r.data.accessToken,status:!0,roles:r.data.roles}),r.data}catch(r){throw c.setError(r),console.log("Sign up falied"),r}},logout(){g("user"),Object.assign(a.user,{email:"",phone:"",password:"",passwordRepeat:""}),Object.assign(a.access,{token:null,status:!1})},async resetPassword(e,t){try{const s=await u.post("/api/auth/reset-password",{email:e.email,phone:e.phone,type:t});return Object.assign(h.state.code,{...s.data,isSended:!0}),s.data}catch(s){return c.setError(s),Promise.reject(s)}},async updatePassword(e,t){const{password:s,passwordRepeat:n}=a.user;if(s!==n){const o={response:{data:{errorCode:"PASSWORDS_DO_NOT_MATCH"}}};throw c.setError(o),new Error(o.response.status)}try{const o=await u.post("/api/auth/update-password",{email:e.email,phone:e.phone,password:e.password,passwordRepeat:e.passwordRepeat,type:t});return o.data.accessToken&&p("user",o.data),Object.assign(a.user,{...o.data}),Object.assign(a.access,{token:o.data.accessToken,status:!0}),o.data}catch(o){return c.setError(o),Promise.reject(o)}}},j={development:{secure:!1,expires:7,sameSite:"Lax"},production:{expires:7,path:"/",domain:process.env.API_URL,sameSite:"none",secure:!0}};async function m(e){if(process.env.MOBILE_APP){const{value:t}=await w.Preferences.get({key:e});return t?JSON.parse(t):null}else{const t=l.default.get(e);return t?JSON.parse(t):null}}function p(e,t,s=process.env.DOMAIN_URL){process.env.MOBILE_APP?w.Preferences.set({key:e,value:JSON.stringify(t)}):l.default.set(e,JSON.stringify(t),j[s])}function g(e,t=process.env.NODE_ENV){if(process.env.MOBILE_APP)w.Preferences.remove({key:e});else{const s=t==="production"?{domain:process.env.API_URL}:{};l.default.remove(e,s)}}f.watch(a,(e,t)=>{});exports.actions=P;exports.state=a;
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import { Preferences as
|
4
|
-
import { reactive as
|
1
|
+
import d from "../../../../node_modules/axios/lib/axios.js";
|
2
|
+
import l from "../../../../../node_modules/js-cookie/dist/js.cookie.js";
|
3
|
+
import { Preferences as w } from "../../../../node_modules/@capacitor/preferences/dist/esm/index.js";
|
4
|
+
import { reactive as f, watch as O } from "vue";
|
5
5
|
import { setError as c } from "../../globals/store/globals.js";
|
6
|
-
import { state as
|
7
|
-
const
|
6
|
+
import { state as h } from "./twofa.js";
|
7
|
+
const p = d.create({ baseURL: process.env.API_URL, withCredentials: !0 }), o = f({
|
8
8
|
user: {
|
9
9
|
_id: void 0,
|
10
10
|
username: "",
|
@@ -17,32 +17,39 @@ const i = w.create({ baseURL: process.env.API_URL, withCredentials: !0 }), r = m
|
|
17
17
|
roles: null,
|
18
18
|
token: null,
|
19
19
|
status: !1
|
20
|
-
}
|
20
|
+
},
|
21
|
+
accesses: []
|
21
22
|
});
|
22
|
-
async function
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
async function k() {
|
24
|
+
try {
|
25
|
+
const e = await j("user");
|
26
|
+
if (e) {
|
27
|
+
const { _id: t, email: s, phone: n, roles: r, accessToken: a } = e;
|
28
|
+
d.interceptors.request.use((i) => (i.headers["x-access-token"] = a, i), (i) => Promise.reject(i));
|
29
|
+
const g = (await d.get("/api/auth/check-accesses")).data;
|
30
|
+
Object.assign(o.user, { _id: t, email: s, phone: n }), Object.assign(o.access, { token: a, roles: r, status: !!a }), o.accesses = g;
|
31
|
+
}
|
32
|
+
} catch (e) {
|
33
|
+
console.error("Error initializing app:", e), m("user"), o.accesses = [];
|
27
34
|
}
|
28
35
|
}
|
29
|
-
|
30
|
-
const
|
36
|
+
k();
|
37
|
+
const C = {
|
31
38
|
async login(e, t) {
|
32
39
|
try {
|
33
|
-
const s = await
|
40
|
+
const s = await p.post("/api/auth/signin", {
|
34
41
|
...e,
|
35
42
|
type: t
|
36
43
|
});
|
37
|
-
return u("user", s.data), Object.assign(
|
44
|
+
return u("user", s.data), Object.assign(o.user, {
|
38
45
|
...s.data
|
39
|
-
}), Object.assign(
|
46
|
+
}), Object.assign(o.access, {
|
40
47
|
token: s.data.accessToken,
|
41
48
|
status: !0,
|
42
49
|
roles: s.data.roles
|
43
50
|
}), s.data;
|
44
51
|
} catch (s) {
|
45
|
-
return Object.assign(
|
52
|
+
return Object.assign(o.access, {
|
46
53
|
token: null,
|
47
54
|
status: !1,
|
48
55
|
roles: null
|
@@ -50,8 +57,8 @@ const R = {
|
|
50
57
|
}
|
51
58
|
},
|
52
59
|
async signup(e, t, s) {
|
53
|
-
const { password: n, passwordRepeat:
|
54
|
-
if (console.log(n), console.log(
|
60
|
+
const { password: n, passwordRepeat: r } = o.user;
|
61
|
+
if (console.log(n), console.log(r), n !== r) {
|
55
62
|
const a = {
|
56
63
|
response: {
|
57
64
|
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
@@ -60,14 +67,14 @@ const R = {
|
|
60
67
|
throw c(a), new Error(a.response.status);
|
61
68
|
}
|
62
69
|
try {
|
63
|
-
const a = await
|
70
|
+
const a = await p.post("/api/auth/signup", {
|
64
71
|
...e,
|
65
72
|
type: t,
|
66
73
|
inviteCode: s
|
67
74
|
});
|
68
|
-
return console.log(a), a.data.accessToken && u("user", a.data), Object.assign(
|
75
|
+
return console.log(a), a.data.accessToken && u("user", a.data), Object.assign(o.user, {
|
69
76
|
...a.data
|
70
|
-
}), Object.assign(
|
77
|
+
}), Object.assign(o.access, {
|
71
78
|
token: a.data.accessToken,
|
72
79
|
status: !0,
|
73
80
|
roles: a.data.roles
|
@@ -77,24 +84,24 @@ const R = {
|
|
77
84
|
}
|
78
85
|
},
|
79
86
|
logout() {
|
80
|
-
|
87
|
+
m("user"), Object.assign(o.user, {
|
81
88
|
email: "",
|
82
89
|
phone: "",
|
83
90
|
password: "",
|
84
91
|
passwordRepeat: ""
|
85
|
-
}), Object.assign(
|
92
|
+
}), Object.assign(o.access, {
|
86
93
|
token: null,
|
87
94
|
status: !1
|
88
95
|
});
|
89
96
|
},
|
90
97
|
async resetPassword(e, t) {
|
91
98
|
try {
|
92
|
-
const s = await
|
99
|
+
const s = await p.post("/api/auth/reset-password", {
|
93
100
|
email: e.email,
|
94
101
|
phone: e.phone,
|
95
102
|
type: t
|
96
103
|
});
|
97
|
-
return Object.assign(
|
104
|
+
return Object.assign(h.code, {
|
98
105
|
...s.data,
|
99
106
|
isSended: !0
|
100
107
|
}), s.data;
|
@@ -103,63 +110,63 @@ const R = {
|
|
103
110
|
}
|
104
111
|
},
|
105
112
|
async updatePassword(e, t) {
|
106
|
-
const { password: s, passwordRepeat: n } =
|
113
|
+
const { password: s, passwordRepeat: n } = o.user;
|
107
114
|
if (s !== n) {
|
108
|
-
const
|
115
|
+
const r = {
|
109
116
|
response: {
|
110
117
|
data: { errorCode: "PASSWORDS_DO_NOT_MATCH" }
|
111
118
|
}
|
112
119
|
};
|
113
|
-
throw c(
|
120
|
+
throw c(r), new Error(r.response.status);
|
114
121
|
}
|
115
122
|
try {
|
116
|
-
const
|
123
|
+
const r = await p.post("/api/auth/update-password", {
|
117
124
|
email: e.email,
|
118
125
|
phone: e.phone,
|
119
126
|
password: e.password,
|
120
127
|
passwordRepeat: e.passwordRepeat,
|
121
128
|
type: t
|
122
129
|
});
|
123
|
-
return
|
124
|
-
...
|
125
|
-
}), Object.assign(
|
126
|
-
token:
|
130
|
+
return r.data.accessToken && u("user", r.data), Object.assign(o.user, {
|
131
|
+
...r.data
|
132
|
+
}), Object.assign(o.access, {
|
133
|
+
token: r.data.accessToken,
|
127
134
|
status: !0
|
128
|
-
}),
|
129
|
-
} catch (
|
130
|
-
return c(
|
135
|
+
}), r.data;
|
136
|
+
} catch (r) {
|
137
|
+
return c(r), Promise.reject(r);
|
131
138
|
}
|
132
139
|
}
|
133
|
-
},
|
140
|
+
}, P = {
|
134
141
|
development: { secure: !1, expires: 7, sameSite: "Lax" },
|
135
142
|
production: { expires: 7, path: "/", domain: process.env.API_URL, sameSite: "none", secure: !0 }
|
136
143
|
};
|
137
|
-
async function
|
144
|
+
async function j(e) {
|
138
145
|
if (process.env.MOBILE_APP) {
|
139
|
-
const { value: t } = await
|
146
|
+
const { value: t } = await w.get({ key: e });
|
140
147
|
return t ? JSON.parse(t) : null;
|
141
148
|
} else {
|
142
|
-
const t =
|
149
|
+
const t = l.get(e);
|
143
150
|
return t ? JSON.parse(t) : null;
|
144
151
|
}
|
145
152
|
}
|
146
153
|
function u(e, t, s = process.env.DOMAIN_URL) {
|
147
|
-
process.env.MOBILE_APP ?
|
154
|
+
process.env.MOBILE_APP ? w.set({
|
148
155
|
key: e,
|
149
156
|
value: JSON.stringify(t)
|
150
|
-
}) :
|
157
|
+
}) : l.set(e, JSON.stringify(t), P[s]);
|
151
158
|
}
|
152
|
-
function
|
159
|
+
function m(e, t = process.env.NODE_ENV) {
|
153
160
|
if (process.env.MOBILE_APP)
|
154
|
-
|
161
|
+
w.remove({ key: e });
|
155
162
|
else {
|
156
163
|
const s = t === "production" ? { domain: process.env.API_URL } : {};
|
157
|
-
|
164
|
+
l.remove(e, s);
|
158
165
|
}
|
159
166
|
}
|
160
|
-
|
167
|
+
O(o, (e, t) => {
|
161
168
|
});
|
162
169
|
export {
|
163
|
-
|
164
|
-
|
170
|
+
C as actions,
|
171
|
+
o as state
|
165
172
|
};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),l=require("../../../mobile/components/Menu/Menu.vue.cjs"),o=require("../../../mobile/components/Menu/MenuItem.vue.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const i=require("../../../icons/entities/IconProducts.vue.cjs"),d=require("../../../icons/entities/IconEvents.vue.cjs"),m=require("../../../icons/entities/IconGroups.vue.cjs"),f=require("../../../icons/entities/IconGallery.vue.cjs"),p=require("../../../icons/entities/IconOrders.vue.cjs"),_=require("../../../icons/entities/IconLeftovers.vue.cjs"),u=require("vue-router"),n=require("../../../auth/store/auth.cjs");require("../../../organizations/store/organizations.cjs");const k={class:""},h=e.createElementVNode("h1",{class:"pd-medium radius-medium bg-light mn-b-small"},"Welcome to Backoffice",-1),v=e.createElementVNode("span",null," Members ",-1),N=e.createElementVNode("span",null," Products ",-1),V=e.createElementVNode("span",null," Leftovers ",-1),C=e.createElementVNode("span",null," Orders ",-1),B=e.createElementVNode("span",null," Gallery ",-1),b=e.createElementVNode("span",null," Events ",-1),g={__name:"Dashboard",props:{favorites:Array},setup(q){const r=u.useRoute(),t=u.useRouter();return e.ref(null),e.ref([]),e.onMounted(async()=>{}),(a,s)=>(e.openBlock(),e.createElementBlock("div",k,[h,e.createVNode(l.default,{class:"bg-light mn-b-semi"},{default:e.withCtx(()=>[a.hasAccess(e.unref(r).params._id,"members","read",n.state.accesses)?(e.openBlock(),e.createBlock(o.default,{key:0,onClick:s[0]||(s[0]=c=>e.unref(t).push({name:"Organization Members",params:{_id:e.unref(r).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(m.default,{class:"i-semi",icon:!0,fill:"rgb(var(--white))"}),v]),_:1})):e.createCommentVNode("",!0),a.hasAccess(e.unref(r).params._id,"products","read",n.state.accesses)?(e.openBlock(),e.createBlock(o.default,{key:1,onClick:s[1]||(s[1]=c=>e.unref(t).push({name:"Products",params:{_id:e.unref(r).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(i.default,{class:"i-semi",icon:!0,fill:"rgb(var(--white))"}),N]),_:1})):e.createCommentVNode("",!0),a.hasAccess(e.unref(r).params._id,"leftovers","read",n.state.accesses)?(e.openBlock(),e.createBlock(o.default,{key:2,onClick:s[2]||(s[2]=c=>e.unref(t).push({name:"Leftovers",params:{_id:e.unref(r).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(_.default,{class:"i-semi",icon:!0,fill:"rgb(var(--white))"}),V]),_:1})):e.createCommentVNode("",!0),a.hasAccess(e.unref(r).params._id,"orders","read",n.state.accesses)?(e.openBlock(),e.createBlock(o.default,{key:3,onClick:s[3]||(s[3]=c=>e.unref(t).push({name:"Backoffice Orders",params:{_id:e.unref(r).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(p.default,{class:"i-semi",icon:!0,fill:"rgb(var(--white))"}),C]),_:1})):e.createCommentVNode("",!0),a.hasAccess(e.unref(r).params._id,"gallery","read",n.state.accesses)?(e.openBlock(),e.createBlock(o.default,{key:4,onClick:s[4]||(s[4]=c=>e.unref(t).push({name:"Backoffice Gallery",params:{_id:e.unref(r).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(f.default,{class:"i-semi",icon:!0,fill:"rgb(var(--white))"}),B]),_:1})):e.createCommentVNode("",!0),a.hasAccess(e.unref(r).params._id,"events","read",n.state.accesses)?(e.openBlock(),e.createBlock(o.default,{key:5,onClick:s[5]||(s[5]=c=>e.unref(t).push({name:"Backoffice Events",params:{_id:e.unref(r).params._id}})),class:"cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(d.default,{class:"i-semi",icon:!0,fill:"rgb(var(--white))"}),b]),_:1})):e.createCommentVNode("",!0)]),_:1})]))}};exports.default=g;
|