@ozdao/martyrs 0.2.585 → 0.2.587
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.server.js +175 -97
- package/dist/{authJwt-J1csaMWA.js → authJwt-DKbMMjw0.js} +33 -0
- package/dist/chats.server.js +3 -3
- package/dist/community.server.js +2 -2
- package/dist/core.server.js +201 -13
- package/dist/{core.websocket-C2FxNmZ1.js → core.websocket-Cl76z2wT.js} +41 -5
- package/dist/{crud-q1ye5IhV.js → crud-DpOXTZep.js} +1 -1
- package/dist/events.server.js +3 -3
- package/dist/files.server.js +2 -2
- package/dist/gallery.server.js +2 -2
- package/dist/index-kvBwwb0w.js +427 -0
- package/dist/inventory.server.js +3 -3
- package/dist/{mailing-DuEFRsa3.js → mailing-DT7nbNjZ.js} +16 -3
- package/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +863 -865
- package/dist/marketplace.server.js +2 -2
- package/dist/martyrs/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +192 -38
- package/dist/martyrs/dist/main-BIf-WirR.js.map +1 -0
- package/dist/martyrs/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +2 -2
- package/dist/martyrs/dist/{web-BA6h6Z8P.js.map → web-O7lXcjg0.js.map} +1 -1
- package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +8 -7
- package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
- package/dist/martyrs/src/components/Feed/Carousel.vue.js +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/martyrs/src/components/Loader/{Loader.vue.js → Loader.vue2.js} +3 -3
- package/dist/martyrs/src/components/Loader/Loader.vue2.js.map +1 -0
- package/dist/martyrs/src/components/LocationMarker/LocationMarker.vue.js +1 -1
- package/dist/martyrs/src/components/Media/Media.vue.js +1 -1
- package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Select/{Select.vue.js → Select.vue2.js} +2 -2
- package/dist/martyrs/src/components/Select/Select.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js +17 -22
- package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js.map +1 -1
- package/dist/martyrs/src/components/UploadImage/UploadImage.vue.js +1 -1
- package/dist/martyrs/src/components/UploadImageMultiple/UploadImageMultiple.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/auth.client.js +18 -24
- package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js +178 -0
- package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +53 -45
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +198 -14
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +70 -29
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +86 -30
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js +100 -0
- package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js.map +1 -0
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js +2 -31
- package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/router/users.router.js +0 -14
- package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/auth.js +1 -56
- package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/store/users.js +5 -1
- package/dist/martyrs/src/modules/auth/views/store/users.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/layouts/Community.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +2 -2
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +0 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js +74 -0
- package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js.map +1 -0
- package/dist/martyrs/src/modules/core/views/components/layouts/App.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +64 -48
- package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js +10 -33
- package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +2 -2
- package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/Feed.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/List.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +2 -2
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/marketplace/views/components/sections/SectionMenu.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +3 -3
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +0 -1
- package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
- package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -2
- package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -2
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +0 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js.map +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/elements/Image360.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +0 -1
- package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +0 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +2 -2
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/music.server.js +1 -1
- package/dist/notifications.server.js +2 -2
- package/dist/orders.server.js +8 -7
- package/dist/organizations.server.js +3 -3
- package/dist/pages.server.js +1 -1
- package/dist/products.server.js +3 -3
- package/dist/profile.schema-C31Lynn3.js +21 -0
- package/dist/rents.server.js +2 -2
- package/dist/reports.server.js +1 -1
- package/dist/sessions.service-COcwjd0f.js +86 -0
- package/dist/spots.server.js +1 -1
- package/dist/style.css +180 -110
- package/dist/{tickets.controller-B7r0mK-5.js → tickets.controller-DdF85W-i.js} +1 -1
- package/dist/visitors.service-B1dhhuSo.js +83 -0
- package/dist/wallet.server.js +3 -3
- package/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +1 -1
- package/package.json +3 -1
- package/src/components/Button/Button.vue +61 -15
- package/src/components/Loader/Loader.vue +1 -1
- package/src/components/Tooltip/Tooltip.vue +31 -23
- package/src/modules/TASKS.MD +30 -1
- package/src/modules/auth/CLAUDE.md +381 -0
- package/src/modules/auth/FIXES.md +0 -38
- package/src/modules/auth/auth.client.js +4 -6
- package/src/modules/auth/auth.server.js +19 -16
- package/src/modules/auth/controllers/middlewares/authJwt.js +59 -17
- package/src/modules/auth/controllers/middlewares/index.js +4 -1
- package/src/modules/auth/controllers/middlewares/otp.middleware.js +166 -0
- package/src/modules/auth/controllers/middlewares/verifySignUp.js +0 -1
- package/src/modules/auth/controllers/middlewares/verifyUser.js +58 -11
- package/src/modules/auth/controllers/routes/auth.routes.js +48 -6
- package/src/modules/auth/controllers/routes/users.routes.js +29 -8
- package/src/modules/auth/controllers/services/auth.service.js +62 -12
- package/src/modules/auth/controllers/services/otp.service.js +109 -0
- package/src/modules/auth/controllers/services/users.service.js +46 -6
- package/src/modules/auth/models/otp.model.js +20 -0
- package/src/modules/auth/views/components/blocks/OtpDialog.vue +168 -0
- package/src/modules/auth/views/components/pages/Profile.vue +18 -13
- package/src/modules/auth/views/components/pages/ProfileEditAccount.vue +199 -45
- package/src/modules/auth/views/components/pages/ResetPassword.vue +170 -132
- package/src/modules/auth/views/components/pages/SignIn.vue +2 -1
- package/src/modules/auth/views/components/pages/SignUp.vue +203 -147
- package/src/modules/auth/views/plugins/otp.plugin.js +104 -0
- package/src/modules/auth/views/router/auth.router.js +1 -24
- package/src/modules/auth/views/router/users.router.js +1 -12
- package/src/modules/auth/views/store/auth.js +0 -68
- package/src/modules/auth/views/store/users.js +6 -2
- package/src/modules/chats/chats.server.js +1 -1
- package/src/modules/community/community.server.js +1 -1
- package/src/modules/core/controllers/classes/core.websocket.js +57 -6
- package/src/modules/core/controllers/middlewares/visitor.logger.js +49 -0
- package/src/modules/core/controllers/services/requests.service.js +53 -0
- package/src/modules/core/controllers/services/sessions.service.js +98 -0
- package/src/modules/core/controllers/services/visitors.service.js +102 -0
- package/src/modules/core/controllers/utils/mailing.js +16 -3
- package/src/modules/core/core.server.js +31 -16
- package/src/modules/core/models/log.model.js +24 -0
- package/src/modules/core/models/request.model.js +30 -0
- package/src/modules/core/models/session.model.js +43 -0
- package/src/modules/core/models/visitor.model.js +28 -0
- package/src/modules/core/views/components/elements/OnlineIndicator.vue +115 -0
- package/src/modules/core/views/components/layouts/App.vue +2 -2
- package/src/modules/core/views/components/layouts/Client.vue +443 -477
- package/src/modules/core/views/components/pages/404.vue +2 -3
- package/src/modules/events/events.server.js +1 -1
- package/src/modules/files/files.server.js +1 -1
- package/src/modules/gallery/gallery.server.js +1 -1
- package/src/modules/governance/governance.server.js +1 -1
- package/src/modules/icons/icons.server.js +1 -1
- package/src/modules/inventory/inventory.server.js +1 -1
- package/src/modules/marketplace/marketplace.server.js +1 -1
- package/src/modules/notifications/notifications.server.js +1 -1
- package/src/modules/orders/controllers/orders.controller.js +3 -3
- package/src/modules/orders/orders.server.js +1 -1
- package/src/modules/organizations/organizations.server.js +1 -1
- package/src/modules/pages/pages.server.js +1 -1
- package/src/modules/products/components/pages/Products.vue +1 -1
- package/src/modules/products/products.server.js +1 -1
- package/src/modules/rents/rents.server.js +1 -1
- package/src/modules/reports/reports.server.js +1 -1
- package/src/modules/spots/spots.server.js +1 -1
- package/src/modules/wallet/wallet.server.js +1 -1
- package/dist/_virtual/alignment-pattern.js +0 -5
- package/dist/_virtual/alignment-pattern.js.map +0 -1
- package/dist/_virtual/browser.js +0 -8
- package/dist/_virtual/browser.js.map +0 -1
- package/dist/_virtual/browser2.js +0 -5
- package/dist/_virtual/browser2.js.map +0 -1
- package/dist/_virtual/canvas.js +0 -5
- package/dist/_virtual/canvas.js.map +0 -1
- package/dist/_virtual/dijkstra.js +0 -5
- package/dist/_virtual/dijkstra.js.map +0 -1
- package/dist/_virtual/error-correction-code.js +0 -5
- package/dist/_virtual/error-correction-code.js.map +0 -1
- package/dist/_virtual/error-correction-level.js +0 -5
- package/dist/_virtual/error-correction-level.js.map +0 -1
- package/dist/_virtual/finder-pattern.js +0 -5
- package/dist/_virtual/finder-pattern.js.map +0 -1
- package/dist/_virtual/format-info.js +0 -5
- package/dist/_virtual/format-info.js.map +0 -1
- package/dist/_virtual/galois-field.js +0 -5
- package/dist/_virtual/galois-field.js.map +0 -1
- package/dist/_virtual/mask-pattern.js +0 -5
- package/dist/_virtual/mask-pattern.js.map +0 -1
- package/dist/_virtual/mode.js +0 -5
- package/dist/_virtual/mode.js.map +0 -1
- package/dist/_virtual/polynomial.js +0 -5
- package/dist/_virtual/polynomial.js.map +0 -1
- package/dist/_virtual/qrcode.js +0 -5
- package/dist/_virtual/qrcode.js.map +0 -1
- package/dist/_virtual/regex.js +0 -5
- package/dist/_virtual/regex.js.map +0 -1
- package/dist/_virtual/segments.js +0 -5
- package/dist/_virtual/segments.js.map +0 -1
- package/dist/_virtual/svg-tag.js +0 -5
- package/dist/_virtual/svg-tag.js.map +0 -1
- package/dist/_virtual/utils.js +0 -5
- package/dist/_virtual/utils.js.map +0 -1
- package/dist/_virtual/utils2.js +0 -5
- package/dist/_virtual/utils2.js.map +0 -1
- package/dist/_virtual/version-check.js +0 -5
- package/dist/_virtual/version-check.js.map +0 -1
- package/dist/_virtual/version.js +0 -5
- package/dist/_virtual/version.js.map +0 -1
- package/dist/index-_Edcmck_.js +0 -170
- package/dist/martyrs/dist/main-xL-jtBkT.js.map +0 -1
- package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +0 -1336
- package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js.map +0 -1
- package/dist/martyrs/src/components/Button/Button.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
- package/dist/martyrs/src/components/Select/Select.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +0 -166
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +0 -118
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +0 -360
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js.map +0 -1
- package/dist/martyrs/src/modules/auth/views/store/twofa.js +0 -40
- package/dist/martyrs/src/modules/auth/views/store/twofa.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js +0 -43
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +0 -47
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js +0 -29
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +0 -89
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js +0 -136
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +0 -238
- package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js +0 -9
- package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js.map +0 -1
- package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js +0 -134
- package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js.map +0 -1
- package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js +0 -106
- package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js +0 -79
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js +0 -14
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js +0 -43
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js +0 -85
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js +0 -40
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js +0 -34
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js +0 -36
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js +0 -367
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js +0 -52
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js +0 -25
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js +0 -24
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js +0 -38
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js +0 -46
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js +0 -149
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js +0 -90
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js +0 -41
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js +0 -44
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js +0 -279
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js +0 -38
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js +0 -33
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js +0 -201
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +0 -84
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js +0 -14
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js +0 -107
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js +0 -61
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js +0 -64
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js.map +0 -1
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +0 -87
- package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js.map +0 -1
- package/dist/profile.schema-CjLOfG7b.js +0 -92
- package/src/modules/auth/controllers/middlewares/visitor.logger.js +0 -75
- package/src/modules/auth/controllers/routes/twofa.routes.js +0 -8
- package/src/modules/auth/controllers/services/twofa.service.js +0 -30
- package/src/modules/auth/models/request.model.js +0 -14
- package/src/modules/auth/models/visitor.model.js +0 -11
- package/src/modules/auth/views/components/pages/EnterCode.vue +0 -204
- package/src/modules/auth/views/components/pages/EnterPassword.vue +0 -123
- package/src/modules/auth/views/components/sections/ProfileEditCredentials.vue +0 -329
- package/src/modules/auth/views/store/twofa.js +0 -70
- package/src/modules/auth//320/220/320/240/320/245/320/230/320/242/320/225/320/232/320/242/320/243/320/240/320/220.md +0 -445
|
@@ -2,14 +2,17 @@ import addMembersQuantity from '@martyrs/src/modules/organizations/controllers/u
|
|
|
2
2
|
import addUserStatusFields from '@martyrs/src/modules/organizations/controllers/utils/addUserStatusFields.js';
|
|
3
3
|
import { Types } from 'mongoose';
|
|
4
4
|
const ObjectId = { Types }.Types.ObjectId;
|
|
5
|
+
|
|
5
6
|
const controllerFactory = db => {
|
|
6
7
|
const User = db.user;
|
|
8
|
+
|
|
7
9
|
const read = async (req, res) => {
|
|
8
10
|
let query = [];
|
|
9
11
|
let match = {};
|
|
10
12
|
let skip = parseInt(req.query.skip) || 0;
|
|
11
13
|
let limit = parseInt(req.query.limit) || 10;
|
|
12
14
|
let matchConditions = [];
|
|
15
|
+
|
|
13
16
|
// Модифицированная проверка _id
|
|
14
17
|
if (req.query._id) {
|
|
15
18
|
// Проверяем, является ли _id валидным ObjectId
|
|
@@ -21,7 +24,9 @@ const controllerFactory = db => {
|
|
|
21
24
|
matchConditions.push({ username: req.query._id });
|
|
22
25
|
}
|
|
23
26
|
}
|
|
27
|
+
|
|
24
28
|
let search = req.query.search;
|
|
29
|
+
|
|
25
30
|
if (search) {
|
|
26
31
|
let regexPattern = '';
|
|
27
32
|
// Экранирование специальных символов в строке поиска
|
|
@@ -47,7 +52,9 @@ const controllerFactory = db => {
|
|
|
47
52
|
],
|
|
48
53
|
});
|
|
49
54
|
}
|
|
55
|
+
|
|
50
56
|
if (matchConditions.length > 0) query.push({ $match: { $and: matchConditions } });
|
|
57
|
+
|
|
51
58
|
query.push({
|
|
52
59
|
$lookup: {
|
|
53
60
|
from: 'orders',
|
|
@@ -74,6 +81,14 @@ const controllerFactory = db => {
|
|
|
74
81
|
});
|
|
75
82
|
query.push(addMembersQuantity());
|
|
76
83
|
if (req.query.user) query.push(addUserStatusFields(req.query.user));
|
|
84
|
+
// Исключаем sensitive поля
|
|
85
|
+
query.push({
|
|
86
|
+
$project: {
|
|
87
|
+
password: 0,
|
|
88
|
+
refreshToken: 0,
|
|
89
|
+
__v: 0
|
|
90
|
+
}
|
|
91
|
+
});
|
|
77
92
|
query.push({
|
|
78
93
|
$skip: skip,
|
|
79
94
|
});
|
|
@@ -102,14 +117,17 @@ const controllerFactory = db => {
|
|
|
102
117
|
if (!user) {
|
|
103
118
|
return res.status(404).send({ errorCode: 'USER_NOT_CREATED', message: 'User is not created.' });
|
|
104
119
|
}
|
|
105
|
-
|
|
120
|
+
const { password, refreshToken, __v, ...safeUser } = user.toObject();
|
|
121
|
+
res.status(200).send(safeUser);
|
|
106
122
|
} catch (err) {
|
|
107
123
|
return res.status(500).send({ errorCode: 'INTERNAL_SERVER_ERROR', message: err });
|
|
108
124
|
}
|
|
109
125
|
};
|
|
110
126
|
const update = async (req, res) => {
|
|
111
127
|
try {
|
|
112
|
-
|
|
128
|
+
// Исключаем email и phone из обновления — для них отдельные роуты
|
|
129
|
+
const { email, phone, ...safeData } = req.body;
|
|
130
|
+
const user = await User.findOneAndUpdate({ _id: req.params._id }, safeData, { new: true }).select('-password -refreshToken -__v');
|
|
113
131
|
if (!user) {
|
|
114
132
|
return res.status(404).send({ errorCode: 'UPDATE_FAILED', message: 'Something wrong when updating user.' });
|
|
115
133
|
}
|
|
@@ -118,11 +136,32 @@ const controllerFactory = db => {
|
|
|
118
136
|
return res.status(500).send({ errorCode: 'INTERNAL_SERVER_ERROR', message: err });
|
|
119
137
|
}
|
|
120
138
|
};
|
|
121
|
-
|
|
139
|
+
|
|
140
|
+
const updateEmail = async (req, res) => {
|
|
141
|
+
try {
|
|
142
|
+
const user = await User.findOneAndUpdate(
|
|
143
|
+
{ _id: req.params._id },
|
|
144
|
+
{ email: req.body.email },
|
|
145
|
+
{ new: true }
|
|
146
|
+
).select('-password -refreshToken -__v');
|
|
147
|
+
if (!user) {
|
|
148
|
+
return res.status(404).send({ errorCode: 'UPDATE_FAILED', message: 'Something wrong when updating email.' });
|
|
149
|
+
}
|
|
150
|
+
res.status(200).send(user);
|
|
151
|
+
} catch (err) {
|
|
152
|
+
return res.status(500).send({ errorCode: 'INTERNAL_SERVER_ERROR', message: err });
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const updatePhone = async (req, res) => {
|
|
122
157
|
try {
|
|
123
|
-
const user = await User.
|
|
158
|
+
const user = await User.findOneAndUpdate(
|
|
159
|
+
{ _id: req.params._id },
|
|
160
|
+
{ phone: req.body.phone },
|
|
161
|
+
{ new: true }
|
|
162
|
+
).select('-password -refreshToken -__v');
|
|
124
163
|
if (!user) {
|
|
125
|
-
return res.status(404).send({ errorCode: '
|
|
164
|
+
return res.status(404).send({ errorCode: 'UPDATE_FAILED', message: 'Something wrong when updating phone.' });
|
|
126
165
|
}
|
|
127
166
|
res.status(200).send(user);
|
|
128
167
|
} catch (err) {
|
|
@@ -133,7 +172,8 @@ const controllerFactory = db => {
|
|
|
133
172
|
read,
|
|
134
173
|
create,
|
|
135
174
|
update,
|
|
136
|
-
|
|
175
|
+
updateEmail,
|
|
176
|
+
updatePhone,
|
|
137
177
|
};
|
|
138
178
|
};
|
|
139
179
|
export default controllerFactory;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export default db => {
|
|
2
|
+
const OtpSchema = new db.mongoose.Schema({
|
|
3
|
+
challengeId: { type: String, required: true, unique: true },
|
|
4
|
+
identifier: { type: String, required: true },
|
|
5
|
+
target: { type: db.mongoose.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
6
|
+
code: { type: String, required: true },
|
|
7
|
+
type: { type: String, enum: ['email', 'phone'], required: true },
|
|
8
|
+
purpose: { type: String, required: true },
|
|
9
|
+
attempts: { type: Number, default: 0 },
|
|
10
|
+
verifiedAt: { type: Date, default: null },
|
|
11
|
+
invalidatedAt: { type: Date, default: null },
|
|
12
|
+
createdAt: { type: Date, default: Date.now, expires: 600 },
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
OtpSchema.index({ identifier: 1, purpose: 1 });
|
|
16
|
+
OtpSchema.index({ target: 1, purpose: 1 }, { sparse: true });
|
|
17
|
+
// challengeId index created by unique: true
|
|
18
|
+
|
|
19
|
+
return db.mongoose.model('Otp', OtpSchema);
|
|
20
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Popup
|
|
3
|
+
:isPopupOpen="otpState.visible"
|
|
4
|
+
@close-popup="cancelOtp"
|
|
5
|
+
class="bg-white w-min-20r w-max-30r w-max-100 radius-medium pd-medium"
|
|
6
|
+
>
|
|
7
|
+
<!-- Single mode -->
|
|
8
|
+
<section v-if="otpState.mode !== 'dual'" class="t-center">
|
|
9
|
+
<h3 class="mn-b-medium">
|
|
10
|
+
{{ otpState.challenge?.type === 'email' ? 'Verify Email' : 'Verify Phone' }}
|
|
11
|
+
</h3>
|
|
12
|
+
|
|
13
|
+
<p class="mn-b-big t-transp">
|
|
14
|
+
{{ otpState.challenge?.type === 'email'
|
|
15
|
+
? 'Enter the code sent to your email'
|
|
16
|
+
: 'Enter the code sent to your phone' }}
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p class="mn-b-small t-transp">{{ otpState.challenge?.identifier }}</p>
|
|
20
|
+
|
|
21
|
+
<div class="pos-relative mn-b-big cursor-text" @click="focusInput(0)">
|
|
22
|
+
<input
|
|
23
|
+
ref="inputRefs"
|
|
24
|
+
v-model="code"
|
|
25
|
+
type="text"
|
|
26
|
+
inputmode="numeric"
|
|
27
|
+
pattern="[0-9]*"
|
|
28
|
+
maxlength="4"
|
|
29
|
+
class="pos-absolute inset-0 w-100 h-100 opacity-0 z-1"
|
|
30
|
+
@input="onInput"
|
|
31
|
+
@keydown="onKeydown"
|
|
32
|
+
autocomplete="one-time-code"
|
|
33
|
+
>
|
|
34
|
+
<div class="d-flex flex-h-center gap-small">
|
|
35
|
+
<div
|
|
36
|
+
v-for="i in 4"
|
|
37
|
+
:key="i"
|
|
38
|
+
class="w-[60px] h-[60px] d-flex flex-center text-[28px] fw-medium bg-light radius-small br-1px ease-cubic"
|
|
39
|
+
:class="code.length === i - 1 ? 'br-main' : 'br-grey'"
|
|
40
|
+
>
|
|
41
|
+
{{ code[i - 1] || '' }}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</section>
|
|
46
|
+
|
|
47
|
+
<!-- Dual mode -->
|
|
48
|
+
<section v-else class="t-center">
|
|
49
|
+
<h3 class="mn-b-medium">Verify Change</h3>
|
|
50
|
+
|
|
51
|
+
<div v-for="(challenge, idx) in otpState.challenges" :key="idx" class="mn-b-big">
|
|
52
|
+
<p class="mn-b-thin t-transp">
|
|
53
|
+
{{ challenge.label === 'old' ? 'Current' : 'New' }}
|
|
54
|
+
</p>
|
|
55
|
+
<p class="mn-b-small">{{ challenge.identifier }}</p>
|
|
56
|
+
|
|
57
|
+
<div class="pos-relative cursor-text" @click="focusDualInput(idx)">
|
|
58
|
+
<input
|
|
59
|
+
:ref="el => dualInputRefs[idx] = el"
|
|
60
|
+
v-model="dualCodes[idx]"
|
|
61
|
+
type="text"
|
|
62
|
+
inputmode="numeric"
|
|
63
|
+
pattern="[0-9]*"
|
|
64
|
+
maxlength="4"
|
|
65
|
+
class="pos-absolute inset-0 w-100 h-100 opacity-0 z-1"
|
|
66
|
+
@input="onDualInput(idx)"
|
|
67
|
+
@keydown="onKeydown"
|
|
68
|
+
autocomplete="one-time-code"
|
|
69
|
+
>
|
|
70
|
+
<div class="d-flex flex-h-center gap-small">
|
|
71
|
+
<div
|
|
72
|
+
v-for="i in 4"
|
|
73
|
+
:key="i"
|
|
74
|
+
class="w-[48px] h-[48px] d-flex flex-center text-[24px] fw-medium bg-light radius-small br-1px ease-cubic"
|
|
75
|
+
:class="dualCodes[idx].length === i - 1 ? 'br-main' : 'br-grey'"
|
|
76
|
+
>
|
|
77
|
+
{{ dualCodes[idx][i - 1] || '' }}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<Button
|
|
84
|
+
@click="submitDual"
|
|
85
|
+
:disabled="!bothComplete"
|
|
86
|
+
class="w-100"
|
|
87
|
+
>
|
|
88
|
+
Confirm
|
|
89
|
+
</Button>
|
|
90
|
+
</section>
|
|
91
|
+
</Popup>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<script setup>
|
|
95
|
+
import { ref, computed, watch } from 'vue'
|
|
96
|
+
import Popup from '@martyrs/src/components/Popup/Popup.vue'
|
|
97
|
+
import { Button } from '@ozdao/martyrs'
|
|
98
|
+
|
|
99
|
+
const props = defineProps({
|
|
100
|
+
otpState: { type: Object, required: true },
|
|
101
|
+
closeOtp: { type: Function, required: true },
|
|
102
|
+
closeDualOtp: { type: Function, required: true },
|
|
103
|
+
cancelOtp: { type: Function, required: true }
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
const inputRefs = ref(null)
|
|
107
|
+
const dualInputRefs = ref([null, null])
|
|
108
|
+
const code = ref('')
|
|
109
|
+
const dualCodes = ref(['', ''])
|
|
110
|
+
|
|
111
|
+
const bothComplete = computed(() =>
|
|
112
|
+
dualCodes.value[0].length === 4 && dualCodes.value[1].length === 4
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
watch(() => props.otpState.visible, (visible) => {
|
|
116
|
+
if (visible) {
|
|
117
|
+
code.value = ''
|
|
118
|
+
dualCodes.value = ['', '']
|
|
119
|
+
setTimeout(() => {
|
|
120
|
+
if (props.otpState.mode === 'dual') {
|
|
121
|
+
dualInputRefs.value[0]?.focus()
|
|
122
|
+
} else {
|
|
123
|
+
inputRefs.value?.focus()
|
|
124
|
+
}
|
|
125
|
+
}, 100)
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
function focusInput() {
|
|
130
|
+
inputRefs.value?.focus()
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function focusDualInput(idx) {
|
|
134
|
+
dualInputRefs.value[idx]?.focus()
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function onKeydown(e) {
|
|
138
|
+
if (!/^\d$/.test(e.key) && !['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab'].includes(e.key) && !e.ctrlKey && !e.metaKey) {
|
|
139
|
+
e.preventDefault()
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function onInput() {
|
|
144
|
+
code.value = code.value.replace(/\D/g, '').slice(0, 4)
|
|
145
|
+
|
|
146
|
+
if (code.value.length === 4) {
|
|
147
|
+
props.closeOtp(code.value)
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function onDualInput(idx) {
|
|
152
|
+
dualCodes.value[idx] = dualCodes.value[idx].replace(/\D/g, '').slice(0, 4)
|
|
153
|
+
|
|
154
|
+
// Auto-focus next input when current is complete
|
|
155
|
+
if (dualCodes.value[idx].length === 4 && idx === 0) {
|
|
156
|
+
dualInputRefs.value[1]?.focus()
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Auto-submit when both are complete
|
|
160
|
+
if (bothComplete.value) {
|
|
161
|
+
submitDual()
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function submitDual() {
|
|
166
|
+
props.closeDualOtp([dualCodes.value[0], dualCodes.value[1]])
|
|
167
|
+
}
|
|
168
|
+
</script>
|
|
@@ -77,20 +77,24 @@
|
|
|
77
77
|
class="cursor-pointer pos-absolute pos-t-regular pos-r-regular i-medium t-transp"
|
|
78
78
|
/>
|
|
79
79
|
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
80
|
+
<div class="pos-relative mn-b-small">
|
|
81
|
+
<img loading="lazy"
|
|
82
|
+
v-if="users.state.current.profile.photo && users.state.current.profile.photo.length > 0"
|
|
83
|
+
:src="(FILE_SERVER_URL || '') + users.state.current.profile.photo"
|
|
84
|
+
class="radius-extra bg-white object-fit-cover i-extra"
|
|
85
|
+
/>
|
|
86
|
+
<PlaceholderUserpic
|
|
87
|
+
v-else
|
|
88
|
+
class="radius-medium i-extra"
|
|
89
|
+
/>
|
|
90
|
+
<OnlineIndicator
|
|
91
|
+
v-if="users.state.current._id"
|
|
92
|
+
:userId="users.state.current._id"
|
|
93
|
+
class="pos-absolute pos-r-0 pos-b-0"
|
|
94
|
+
/>
|
|
95
|
+
</div>
|
|
90
96
|
|
|
91
|
-
<h3
|
|
92
|
-
class="mn-b-thin"
|
|
93
|
-
>
|
|
97
|
+
<h3 class="mn-b-thin">
|
|
94
98
|
{{users.state.current.profile.name ? users.state.current.profile.name : 'Anonymous' }}
|
|
95
99
|
</h3>
|
|
96
100
|
|
|
@@ -257,6 +261,7 @@ import IconOrders from '@martyrs/src/modules/icons/entities/IconOrders.vue'
|
|
|
257
261
|
import IconEdit from '@martyrs/src/modules/icons/navigation/IconEdit.vue'
|
|
258
262
|
|
|
259
263
|
import PlaceholderUserpic from '@martyrs/src/modules/icons/placeholders/PlaceholderUserpic.vue'
|
|
264
|
+
import OnlineIndicator from '@martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue'
|
|
260
265
|
// Import libs
|
|
261
266
|
import { computed, watch, onMounted, onServerPrefetch, ref, onBeforeMount, inject } from 'vue'
|
|
262
267
|
import { useRoute, useRouter } from 'vue-router'
|
|
@@ -1,28 +1,132 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="for-transition w-100">
|
|
3
|
-
|
|
3
|
+
<!-- Phone and Email -->
|
|
4
|
+
<div class="bg-white mn-b-thin">
|
|
5
|
+
<h3 class="mn-b-small">Phone and Email</h3>
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
<!-- Phone -->
|
|
8
|
+
<div class="mn-b-semi">
|
|
9
|
+
<Field
|
|
10
|
+
v-if="users.state.current.phone && !isEditingPhone"
|
|
11
|
+
v-model:field="users.state.current.phone"
|
|
12
|
+
label="Phone"
|
|
13
|
+
class="mn-b-thin bg-light pd-medium radius-small"
|
|
14
|
+
disabled
|
|
15
|
+
/>
|
|
16
|
+
<FieldPhone
|
|
17
|
+
v-else
|
|
18
|
+
@change="(val) => newPhone = val"
|
|
19
|
+
:dropdownOptions="{
|
|
20
|
+
showDialCodeInSelection: true,
|
|
21
|
+
showFlags: true,
|
|
22
|
+
showDialCodeInList: true
|
|
23
|
+
}"
|
|
24
|
+
:validCharactersOnly="true"
|
|
25
|
+
mode="national"
|
|
26
|
+
:inputOptions="{ placeholder: 'Enter phone number', type: 'tel' }"
|
|
27
|
+
class="bg-light h-4r pd-small radius-small mn-b-thin"
|
|
28
|
+
/>
|
|
29
|
+
<Button
|
|
30
|
+
v-if="users.state.current.phone && !isEditingPhone"
|
|
31
|
+
:submit="() => isEditingPhone = true"
|
|
32
|
+
class="mn-b-thin t-black bg-light w-100"
|
|
33
|
+
>
|
|
34
|
+
Change Phone
|
|
35
|
+
</Button>
|
|
36
|
+
<div v-else-if="!users.state.current.phone" class="flex gap-1">
|
|
37
|
+
<Button
|
|
38
|
+
:submit="() => savePhone()"
|
|
39
|
+
class="mn-b-thin bg-main w-100"
|
|
40
|
+
>
|
|
41
|
+
Save Phone
|
|
42
|
+
</Button>
|
|
43
|
+
</div>
|
|
44
|
+
<div v-else class="flex gap-2">
|
|
45
|
+
<Button
|
|
46
|
+
:submit="() => savePhone()"
|
|
47
|
+
class="mn-b-thin bg-main flex-child-1"
|
|
48
|
+
>
|
|
49
|
+
Save Phone
|
|
50
|
+
</Button>
|
|
51
|
+
<Button
|
|
52
|
+
:submit="() => { isEditingPhone = false; newPhone = '' }"
|
|
53
|
+
class="mn-b-thin bg-red t-white flex-child-1"
|
|
54
|
+
>
|
|
55
|
+
Cancel
|
|
56
|
+
</Button>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<!-- Email -->
|
|
61
|
+
<div class="mn-b-semi">
|
|
62
|
+
<Field
|
|
63
|
+
v-if="users.state.current.email && !isEditingEmail"
|
|
64
|
+
v-model:field="users.state.current.email"
|
|
65
|
+
label="Email"
|
|
66
|
+
class="mn-b-thin bg-light pd-medium radius-small"
|
|
67
|
+
disabled
|
|
68
|
+
/>
|
|
69
|
+
<Field
|
|
70
|
+
v-else
|
|
71
|
+
v-model:field="newEmail"
|
|
72
|
+
label="Email"
|
|
73
|
+
placeholder="Enter email"
|
|
74
|
+
class="mn-b-thin bg-light pd-medium radius-small"
|
|
75
|
+
/>
|
|
76
|
+
<Button
|
|
77
|
+
v-if="users.state.current.email && !isEditingEmail"
|
|
78
|
+
:submit="() => isEditingEmail = true"
|
|
79
|
+
class="mn-b-thin t-black bg-light w-100"
|
|
80
|
+
>
|
|
81
|
+
Change Email
|
|
82
|
+
</Button>
|
|
83
|
+
<div v-else-if="!users.state.current.email" class="flex gap-1">
|
|
84
|
+
<Button
|
|
85
|
+
:submit="() => saveEmail()"
|
|
86
|
+
class="mn-b-thin bg-main w-100"
|
|
87
|
+
>
|
|
88
|
+
Save Email
|
|
89
|
+
</Button>
|
|
90
|
+
</div>
|
|
91
|
+
<div v-else class="flex gap-2">
|
|
92
|
+
<Button
|
|
93
|
+
:submit="() => saveEmail()"
|
|
94
|
+
class="mn-b-thin bg-main flex-child-1"
|
|
95
|
+
>
|
|
96
|
+
Save Email
|
|
97
|
+
</Button>
|
|
98
|
+
<Button
|
|
99
|
+
:submit="() => { isEditingEmail = false; newEmail = '' }"
|
|
100
|
+
class="mn-b-thin bg-red t-white flex-child-1"
|
|
101
|
+
>
|
|
102
|
+
Cancel
|
|
103
|
+
</Button>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<!-- Settings -->
|
|
109
|
+
<div class="bg-white mn-b-thin">
|
|
6
110
|
<h3 class="mn-b-small">Settings</h3>
|
|
7
111
|
<Checkbox
|
|
8
112
|
:label="'Darkmode'"
|
|
9
113
|
:radio="core.state.theme.mode === 'dark'"
|
|
10
|
-
@update:radio="
|
|
114
|
+
@update:radio="() => core.actions.toggleTheme()"
|
|
11
115
|
class="w-100 bg-light t-black pd-medium radius-small"
|
|
12
116
|
/>
|
|
13
117
|
</div>
|
|
14
118
|
|
|
15
|
-
<Button
|
|
16
|
-
:submit="onSubmit"
|
|
17
|
-
:callback="redirectTo"
|
|
119
|
+
<Button
|
|
120
|
+
:submit="onSubmit"
|
|
121
|
+
:callback="redirectTo"
|
|
18
122
|
class="mn-b-thin bg-main w-100"
|
|
19
|
-
>
|
|
123
|
+
>
|
|
20
124
|
Save
|
|
21
125
|
</Button>
|
|
22
126
|
|
|
23
127
|
<Button
|
|
24
|
-
:submit="onSubmitDelete"
|
|
25
|
-
:callback="() => router.push({name: 'Sign In'})"
|
|
128
|
+
:submit="onSubmitDelete"
|
|
129
|
+
:callback="() => router.push({ name: 'Sign In' })"
|
|
26
130
|
class="mn-b-thin w-100 bg-red t-white"
|
|
27
131
|
>
|
|
28
132
|
Delete Account
|
|
@@ -31,42 +135,92 @@
|
|
|
31
135
|
</template>
|
|
32
136
|
|
|
33
137
|
<script setup>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
138
|
+
import Checkbox from '@martyrs/src/components/Checkbox/Checkbox.vue'
|
|
139
|
+
import Button from '@martyrs/src/components/Button/Button.vue'
|
|
140
|
+
import Field from '@martyrs/src/components/Field/Field.vue'
|
|
141
|
+
import FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'
|
|
142
|
+
|
|
143
|
+
import { ref } from 'vue'
|
|
144
|
+
import { useRouter } from 'vue-router'
|
|
145
|
+
|
|
146
|
+
import * as auth from '@martyrs/src/modules/auth/views/store/auth.js'
|
|
147
|
+
import * as users from '@martyrs/src/modules/auth/views/store/users.js'
|
|
148
|
+
import { useStore, setError } from '@martyrs/src/modules/core/views/store/core.store.js'
|
|
149
|
+
import { withOtp } from '@martyrs/src/modules/auth/views/plugins/otp.plugin.js'
|
|
150
|
+
import $axios from '@martyrs/src/modules/core/views/utils/axios-instance.js'
|
|
151
|
+
|
|
152
|
+
const store = useStore()
|
|
153
|
+
const core = store.core
|
|
154
|
+
const router = useRouter()
|
|
155
|
+
|
|
156
|
+
const isEditingPhone = ref(false)
|
|
157
|
+
const isEditingEmail = ref(false)
|
|
158
|
+
const newPhone = ref('')
|
|
159
|
+
const newEmail = ref('')
|
|
160
|
+
|
|
161
|
+
defineProps({
|
|
162
|
+
userData: {
|
|
163
|
+
type: Object,
|
|
164
|
+
required: true
|
|
57
165
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
async function savePhone() {
|
|
169
|
+
if (!newPhone.value) return
|
|
170
|
+
|
|
171
|
+
try {
|
|
172
|
+
const result = await withOtp(
|
|
173
|
+
(data) => $axios.put(`/api/users/${users.state.current._id}/phone`, data),
|
|
174
|
+
{ phone: newPhone.value }
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
if (result.data) {
|
|
178
|
+
users.state.current.phone = result.data.phone
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
isEditingPhone.value = false
|
|
182
|
+
newPhone.value = ''
|
|
183
|
+
} catch (error) {
|
|
184
|
+
console.log('savePhone catch:', error)
|
|
185
|
+
setError(error)
|
|
67
186
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async function saveEmail() {
|
|
190
|
+
if (!newEmail.value) return
|
|
191
|
+
|
|
192
|
+
try {
|
|
193
|
+
const result = await withOtp(
|
|
194
|
+
(data) => $axios.put(`/api/users/${users.state.current._id}/email`, data),
|
|
195
|
+
{ email: newEmail.value }
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
if (result.data) {
|
|
199
|
+
users.state.current.email = result.data.email
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
isEditingEmail.value = false
|
|
203
|
+
newEmail.value = ''
|
|
204
|
+
} catch (error) {
|
|
205
|
+
setError(error)
|
|
71
206
|
}
|
|
72
|
-
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
async function onSubmit() {
|
|
210
|
+
await users.actions.update(users.state.current)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
async function onSubmitDelete() {
|
|
214
|
+
const confirmation = window.confirm("Are you sure you want to delete your account? Restoration will be possible only with the help of an administrator.")
|
|
215
|
+
|
|
216
|
+
if (!confirmation) return
|
|
217
|
+
|
|
218
|
+
users.state.current.status = 'removed'
|
|
219
|
+
await users.actions.update(users.state.current)
|
|
220
|
+
auth.actions.logout()
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function redirectTo() {
|
|
224
|
+
router.back()
|
|
225
|
+
}
|
|
226
|
+
</script>
|