@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
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="t-center pd-medium">
|
|
3
|
-
<!-- <img loading="lazy" src="@/assets/icons/message1.png" class="i-extra mn-b-small"> -->
|
|
4
|
-
|
|
5
|
-
<h3 class="mn-b-medium">
|
|
6
|
-
{{ route.query.type === 'email' ? t('auth.enterCode.verifyEmailTitle') : t('auth.enterCode.verifyNumberTitle') }}
|
|
7
|
-
</h3>
|
|
8
|
-
|
|
9
|
-
<p class="mn-b-big t-transp">{{ route.query.type === 'email' ? t('auth.enterCode.instructionsEmail') : t('auth.enterCode.instructions') }}</p>
|
|
10
|
-
|
|
11
|
-
<div class="w-100 mn-b-big flex-nowrap flex">
|
|
12
|
-
<input
|
|
13
|
-
type="number"
|
|
14
|
-
v-model="state.digits[0]"
|
|
15
|
-
ref="firstInput"
|
|
16
|
-
maxlength="1"
|
|
17
|
-
@input="onInput(0)"
|
|
18
|
-
@paste="($event) => onPaste($event, 0)"
|
|
19
|
-
@keydown="($event) => onKeyDown($event, 0)"
|
|
20
|
-
class="w-100 h1 pd-small t-center bg-light radius-small mn-r-small"
|
|
21
|
-
>
|
|
22
|
-
<input
|
|
23
|
-
type="number"
|
|
24
|
-
v-model="state.digits[1]"
|
|
25
|
-
maxlength="1"
|
|
26
|
-
@input="onInput(1)"
|
|
27
|
-
@paste="($event) => onPaste($event, 1)"
|
|
28
|
-
@keydown="($event) => onKeyDown($event, 1)"
|
|
29
|
-
class="w-100 h1 pd-small t-center bg-light radius-small mn-r-small"
|
|
30
|
-
>
|
|
31
|
-
<input
|
|
32
|
-
type="number"
|
|
33
|
-
v-model="state.digits[2]"
|
|
34
|
-
maxlength="1"
|
|
35
|
-
@input="onInput(2)"
|
|
36
|
-
@paste="($event) => onPaste($event, 2)"
|
|
37
|
-
@keydown="($event) => onKeyDown($event, 2)"
|
|
38
|
-
class="w-100 h1 pd-small t-center bg-light radius-small mn-r-small"
|
|
39
|
-
>
|
|
40
|
-
<input
|
|
41
|
-
type="number"
|
|
42
|
-
v-model="state.digits[3]"
|
|
43
|
-
maxlength="1"
|
|
44
|
-
@input="onInput(3)"
|
|
45
|
-
@paste="($event) => onPaste($event, 3)"
|
|
46
|
-
@keydown="($event) => onKeyDown($event, 3)"
|
|
47
|
-
class="w-100 h1 pd-small t-center bg-light radius-small"
|
|
48
|
-
>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
<a v-if="resendTimer < 1" @click="sendAgain" class="t-blue">
|
|
52
|
-
{{ t('auth.enterCode.resendCode') }}
|
|
53
|
-
</a>
|
|
54
|
-
|
|
55
|
-
<span v-else>
|
|
56
|
-
{{resendTimer}} {{ t('auth.enterCode.secondsResend') }}
|
|
57
|
-
</span>
|
|
58
|
-
</section>
|
|
59
|
-
</template>
|
|
60
|
-
|
|
61
|
-
<script setup>
|
|
62
|
-
// Import components
|
|
63
|
-
import Field from '@martyrs/src/components/Field/Field.vue'
|
|
64
|
-
// Import libs
|
|
65
|
-
import { computed,reactive,ref, onMounted, onBeforeMount, watch } from 'vue'
|
|
66
|
-
import { useRoute,useRouter } from 'vue-router'
|
|
67
|
-
import { useI18n } from 'vue-i18n'
|
|
68
|
-
// Import state
|
|
69
|
-
import * as auth from '@martyrs/src/modules/auth/views/store/auth.js'
|
|
70
|
-
import * as twofa from '@martyrs/src/modules/auth/views/store/twofa.js'
|
|
71
|
-
import { setError } from '@martyrs/src/modules/core/views/store/core.store.js'
|
|
72
|
-
|
|
73
|
-
const route = useRoute()
|
|
74
|
-
const router = useRouter()
|
|
75
|
-
|
|
76
|
-
// Localization
|
|
77
|
-
// Localization
|
|
78
|
-
const { t } = useI18n({
|
|
79
|
-
useScope: 'global',
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
const state = reactive({
|
|
83
|
-
digits: ['', '', '', ''],
|
|
84
|
-
error: null,
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
watch(
|
|
88
|
-
() => state.digits[0],
|
|
89
|
-
(newVal) => {
|
|
90
|
-
if (newVal && String(newVal).length > 1) {
|
|
91
|
-
let newValArray = String(newVal).split('');
|
|
92
|
-
console.log(newValArray);
|
|
93
|
-
|
|
94
|
-
let newDigits = [...state.digits];
|
|
95
|
-
newValArray.forEach((digit, i) => {
|
|
96
|
-
console.log(i);
|
|
97
|
-
console.log(newDigits[i]);
|
|
98
|
-
console.log(digit);
|
|
99
|
-
newDigits[i] = digit;
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
state.digits = newDigits;
|
|
103
|
-
|
|
104
|
-
onInput(3);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
|
|
109
|
-
const firstInput = ref(null);
|
|
110
|
-
|
|
111
|
-
const resendTimer = ref(0);
|
|
112
|
-
|
|
113
|
-
async function sendAgain () {
|
|
114
|
-
try {
|
|
115
|
-
await twofa.sendCode(
|
|
116
|
-
auth.state.user,
|
|
117
|
-
route.query.method,
|
|
118
|
-
route.query.type,
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
resendTimer.value = 30;
|
|
122
|
-
|
|
123
|
-
// Start the timer using `setInterval()`
|
|
124
|
-
const timer = setInterval(() => {
|
|
125
|
-
if (resendTimer.value > 0) {
|
|
126
|
-
// Decrement the timer by 1 second
|
|
127
|
-
resendTimer.value -= 1;
|
|
128
|
-
} else {
|
|
129
|
-
// Stop the timer when it reaches 0 seconds
|
|
130
|
-
clearInterval(timer);
|
|
131
|
-
}
|
|
132
|
-
}, 1000);
|
|
133
|
-
} catch (error) {
|
|
134
|
-
setError({ response: {data: { errorCode: "CODE_NOT_SENT"}}})
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const onKeyDown = (event, index) => {
|
|
140
|
-
if (event.key === "Backspace" && (state.digits[index] === null || state.digits[index] === undefined || state.digits[index] === '')) {
|
|
141
|
-
event.preventDefault();
|
|
142
|
-
|
|
143
|
-
const inputs = document.querySelectorAll('input');
|
|
144
|
-
const prevInput = index > 0 ? inputs[index - 1] : null;
|
|
145
|
-
|
|
146
|
-
if (prevInput) {
|
|
147
|
-
prevInput.focus();
|
|
148
|
-
prevInput.setSelectionRange(prevInput.value.length, prevInput.value.length);
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
// const onPaste = (event, index) => {
|
|
154
|
-
// event.preventDefault();
|
|
155
|
-
// const pastedData = event.clipboardData.getData('text/plain');
|
|
156
|
-
|
|
157
|
-
// // Проверим, что вставленный текст состоит только из 4 цифр
|
|
158
|
-
// if (/^\d{4}$/.test(pastedData)) {
|
|
159
|
-
// for (let i = 0; i < 4; i++) {
|
|
160
|
-
// state.digits[index + i] = pastedData[i];
|
|
161
|
-
// }
|
|
162
|
-
// onInput(index + 3); // Вызываем обработчик onInput для последнего инпута, чтобы обработать логику ввода
|
|
163
|
-
// } else {
|
|
164
|
-
// setError({ response: {data: { errorCode: "INPUT_ERROR"}}})
|
|
165
|
-
// }
|
|
166
|
-
// };
|
|
167
|
-
|
|
168
|
-
const onInput = (index) => {
|
|
169
|
-
const inputs = document.querySelectorAll('input');
|
|
170
|
-
const nextInput = inputs[index + 1];
|
|
171
|
-
const prevInput = index > 0 ? inputs[index - 1] : null;
|
|
172
|
-
|
|
173
|
-
// Переход на следующий инпут
|
|
174
|
-
if (state.digits[index] !== '' && state.digits[index] !== null && state.digits[index] !== undefined && index < 4) {
|
|
175
|
-
if (index < 3) nextInput.focus();
|
|
176
|
-
else firstInput.value.focus();
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// Переход на предыдущий инпут при удалении
|
|
180
|
-
if ((state.digits[index] === null || state.digits[index] === undefined || state.digits[index] === '') && index > 0) {
|
|
181
|
-
prevInput.focus();
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// Проверка введенного кода
|
|
185
|
-
if (state.digits.every(digit => digit !== '')) {
|
|
186
|
-
const enteredCode = state.digits.join('');
|
|
187
|
-
const correctCode = twofa.state.code.code.toString();
|
|
188
|
-
|
|
189
|
-
if (enteredCode === correctCode) {
|
|
190
|
-
twofa.state.code.isValid = true;
|
|
191
|
-
|
|
192
|
-
router.push({
|
|
193
|
-
path: '/auth/enter-password',
|
|
194
|
-
query: { type: twofa.state.code.type, method: route.query.method, returnUrl: route.query.returnUrl }
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
} else {
|
|
198
|
-
setError({ response: {data: { errorCode: "WRONG_CODE"}}})
|
|
199
|
-
firstInput.value.focus()
|
|
200
|
-
state.digits = ['', '', '', ''];
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
</script>
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="t-left pd-medium">
|
|
3
|
-
<!-- Header -->
|
|
4
|
-
<!-- <img loading="lazy" src="@/assets/icons/password.png" class="i-extra mn-b-small"> -->
|
|
5
|
-
<h3 class="mn-b-small">{{ t('auth.enterPassword.almostDone') }}</h3>
|
|
6
|
-
<p v-if="route.query.method === 'reset-password'" class="mn-b-semi t-transp">{{ t('auth.enterPassword.newPasswordPrompt') }}</p>
|
|
7
|
-
<p v-else class="mn-b-semi t-transp">{{ t('auth.enterPassword.registrationPasswordPrompt') }}</p>
|
|
8
|
-
|
|
9
|
-
<!-- Form -->
|
|
10
|
-
<div class="mn-b-semi radius-small o-hidden">
|
|
11
|
-
<Field
|
|
12
|
-
v-model:field="auth.state.user.password"
|
|
13
|
-
type="password"
|
|
14
|
-
:validation="passswordValidation"
|
|
15
|
-
:placeholder="t('auth.enterPassword.passwordPlaceholder')"
|
|
16
|
-
class="bg-light pd-small radius-small mn-b-thin"
|
|
17
|
-
/>
|
|
18
|
-
<Field
|
|
19
|
-
v-model:field="auth.state.user.passwordRepeat"
|
|
20
|
-
type="password"
|
|
21
|
-
:placeholder="t('auth.enterPassword.repeatPasswordPlaceholder')"
|
|
22
|
-
class="bg-light pd-small radius-small mn-b-thin"
|
|
23
|
-
/>
|
|
24
|
-
</div>
|
|
25
|
-
<div
|
|
26
|
-
v-if="route.query.method !== 'reset-password'"
|
|
27
|
-
class="p-regular fw-semi mn-b-semi "
|
|
28
|
-
>
|
|
29
|
-
By registering, you agree to our <a class="t-grey" href="/legal/eula" target="_blank" rel="noopener noreferrer">End User License Agreement (EULA)</a>
|
|
30
|
-
</div>
|
|
31
|
-
<!-- Button -->
|
|
32
|
-
<Button :submit="onSubmit" :callback="redirectTo" class="w-100 bg-main mn-b-big">
|
|
33
|
-
<span v-if="route.query.method === 'reset-password'">{{ t('auth.enterPassword.changePasswordBtn') }}</span>
|
|
34
|
-
<span v-else>{{ t('auth.enterPassword.registerBtn') }}</span>
|
|
35
|
-
</Button>
|
|
36
|
-
</section>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script setup>
|
|
40
|
-
// Import components
|
|
41
|
-
import Tab from '@martyrs/src/components/Tab/Tab.vue'
|
|
42
|
-
import Field from '@martyrs/src/components/Field/Field.vue'
|
|
43
|
-
import Button from '@martyrs/src/components/Button/Button.vue'
|
|
44
|
-
// Import libs
|
|
45
|
-
import { computed, onMounted, ref, onBeforeMount } from 'vue'
|
|
46
|
-
import { useRoute, useRouter } from 'vue-router'
|
|
47
|
-
import { useI18n } from 'vue-i18n'
|
|
48
|
-
// Import state
|
|
49
|
-
import * as auth from '@martyrs/src/modules/auth/views/store/auth.js'
|
|
50
|
-
// Import validation
|
|
51
|
-
import * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'
|
|
52
|
-
const passswordValidation = ref(null)
|
|
53
|
-
// Localization
|
|
54
|
-
const { t } = useI18n({
|
|
55
|
-
useScope: 'global',
|
|
56
|
-
})
|
|
57
|
-
// Accessing router
|
|
58
|
-
const route = useRoute()
|
|
59
|
-
const router = useRouter()
|
|
60
|
-
// Accessing state
|
|
61
|
-
const tabAuth = ref('phone')
|
|
62
|
-
// Methods
|
|
63
|
-
async function onSubmit() {
|
|
64
|
-
try {
|
|
65
|
-
await inputsValidation.validateInputs(
|
|
66
|
-
passswordValidation,
|
|
67
|
-
inputsValidation.validatePassword,
|
|
68
|
-
auth.state.user.password,
|
|
69
|
-
'Некорректный пароль'
|
|
70
|
-
)
|
|
71
|
-
} catch (error) {
|
|
72
|
-
throw new Error
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (route.query.method === 'reset-password') await auth.actions.updatePassword(auth.state.user, route.query.type)
|
|
76
|
-
if (route.query.method !== 'reset-password') await auth.actions.signup(auth.state.user, route.query.type)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function redirectTo () {
|
|
80
|
-
if (route.query.returnUrl) {
|
|
81
|
-
router.push({
|
|
82
|
-
path: route.query.returnUrl,
|
|
83
|
-
query: {
|
|
84
|
-
afterAuth: 'true'
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
} else {
|
|
88
|
-
router.push({
|
|
89
|
-
name: 'User Profile',
|
|
90
|
-
params: {
|
|
91
|
-
_id: auth.state.user._id
|
|
92
|
-
},
|
|
93
|
-
query: {
|
|
94
|
-
afterAuth: 'true'
|
|
95
|
-
}
|
|
96
|
-
})
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
</script>
|
|
100
|
-
|
|
101
|
-
<style lang="scss">
|
|
102
|
-
.slide-fade-enter-active {
|
|
103
|
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.slide-fade-leave-active {
|
|
107
|
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.slide-fade-enter-from,
|
|
112
|
-
.slide-fade-leave-to {
|
|
113
|
-
position: absolute;
|
|
114
|
-
transform: translateX(20px);
|
|
115
|
-
opacity: 0;
|
|
116
|
-
left: 0;
|
|
117
|
-
top: 0;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.slide-fade-leave-to {
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
</style>
|
|
@@ -1,329 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div v-if="show" class="">
|
|
3
|
-
<h3 class="mn-b-small">Phone and Email</h3>
|
|
4
|
-
|
|
5
|
-
<!-- Email section -->
|
|
6
|
-
<div v-if="!users.state.current.email" class="mn-b-semi">
|
|
7
|
-
<div v-if="isAddingEmail">
|
|
8
|
-
<Field
|
|
9
|
-
v-model:field="newEmail"
|
|
10
|
-
label="Email"
|
|
11
|
-
placeholder="Enter your email"
|
|
12
|
-
class="mn-b-thin bg-light pd-medium radius-small"
|
|
13
|
-
:disabled="isVerificationSent"
|
|
14
|
-
/>
|
|
15
|
-
<div class="flex gap-2">
|
|
16
|
-
<Button
|
|
17
|
-
v-if="!isVerificationSent"
|
|
18
|
-
:submit="() => sendVerification('email', 'add')"
|
|
19
|
-
class="mn-b-thin t-white bg-second flex-child-1"
|
|
20
|
-
>
|
|
21
|
-
Add Email
|
|
22
|
-
</Button>
|
|
23
|
-
<Button
|
|
24
|
-
v-if="!isVerificationSent"
|
|
25
|
-
:submit="() => cancelAdding('email')"
|
|
26
|
-
class="mn-b-thin bg-red t-white flex-child-1"
|
|
27
|
-
>
|
|
28
|
-
Cancel
|
|
29
|
-
</Button>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
<Button
|
|
33
|
-
v-if="!isAddingEmail"
|
|
34
|
-
:submit="() => startAdding('email')"
|
|
35
|
-
class="mn-b-thin t-white bg-second w-100"
|
|
36
|
-
>
|
|
37
|
-
Add Email
|
|
38
|
-
</Button>
|
|
39
|
-
</div>
|
|
40
|
-
|
|
41
|
-
<!-- Phone section -->
|
|
42
|
-
<div v-if="!users.state.current.phone" class="mn-b-semi">
|
|
43
|
-
<div v-if="isAddingPhone">
|
|
44
|
-
<FieldPhone
|
|
45
|
-
@change="(event) => newPhone = event"
|
|
46
|
-
:dropdownOptions="{
|
|
47
|
-
showDialCodeInSelection: true,
|
|
48
|
-
showFlags: true,
|
|
49
|
-
showDialCodeInList: true
|
|
50
|
-
}"
|
|
51
|
-
:validCharactersOnly="true"
|
|
52
|
-
mode="national"
|
|
53
|
-
:inputOptions="{placeholder: 'Enter your phone number', type: 'tel'}"
|
|
54
|
-
class="bg-light h-4r pd-small radius-small mn-b-thin"
|
|
55
|
-
/>
|
|
56
|
-
|
|
57
|
-
<div class="flex gap-2">
|
|
58
|
-
<Button
|
|
59
|
-
v-if="!isVerificationSent"
|
|
60
|
-
:submit="() => sendVerification('phone', 'add')"
|
|
61
|
-
class="mn-b-thin t-white bg-second flex-child-1"
|
|
62
|
-
>
|
|
63
|
-
Add Phone
|
|
64
|
-
</Button>
|
|
65
|
-
<Button
|
|
66
|
-
v-if="!isVerificationSent"
|
|
67
|
-
:submit="() => cancelAdding('phone')"
|
|
68
|
-
class="mn-b-thin t-white bg-second t-white flex-child-1"
|
|
69
|
-
>
|
|
70
|
-
Cancel
|
|
71
|
-
</Button>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
<Button
|
|
75
|
-
v-if="!isAddingPhone"
|
|
76
|
-
:submit="() => startAdding('phone')"
|
|
77
|
-
class="mn-b-thin bg-main w-100"
|
|
78
|
-
>
|
|
79
|
-
Add Phone
|
|
80
|
-
</Button>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<!-- Current contact info with edit options -->
|
|
84
|
-
<div class="mn-b-semi">
|
|
85
|
-
<!-- Current/Edit Phone -->
|
|
86
|
-
<div v-if="users.state.current.phone" class="mn-b-thin">
|
|
87
|
-
<Field
|
|
88
|
-
v-if="!isEditingPhone"
|
|
89
|
-
v-model:field="users.state.current.phone"
|
|
90
|
-
label="Phone"
|
|
91
|
-
class="mn-b-thin bg-light pd-medium radius-small"
|
|
92
|
-
disabled="true"
|
|
93
|
-
/>
|
|
94
|
-
<Field
|
|
95
|
-
v-else
|
|
96
|
-
v-model:field="newPhone"
|
|
97
|
-
label="New Phone"
|
|
98
|
-
placeholder="Enter new phone number"
|
|
99
|
-
class="mn-b-thin t-black bg-light pd-medium radius-small"
|
|
100
|
-
:disabled="isVerificationSent"
|
|
101
|
-
/>
|
|
102
|
-
<Button
|
|
103
|
-
v-if="!isEditingPhone && !isVerificationSent"
|
|
104
|
-
:submit="() => startEditing('phone')"
|
|
105
|
-
class="mn-b-thin t-black bg-light w-100"
|
|
106
|
-
>
|
|
107
|
-
Change Phone
|
|
108
|
-
</Button>
|
|
109
|
-
<Button
|
|
110
|
-
v-if="isEditingPhone && !isVerificationSent"
|
|
111
|
-
:submit="() => sendVerification('phone', 'edit')"
|
|
112
|
-
class="mn-b-thin bg-main w-100"
|
|
113
|
-
>
|
|
114
|
-
Verify New Phone
|
|
115
|
-
</Button>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<!-- Current/Edit Email -->
|
|
119
|
-
<div v-if="users.state.current.email">
|
|
120
|
-
<Field
|
|
121
|
-
v-if="!isEditingEmail"
|
|
122
|
-
v-model:field="users.state.current.email"
|
|
123
|
-
label="Email"
|
|
124
|
-
class="mn-b-thin bg-light pd-medium radius-small"
|
|
125
|
-
disabled="true"
|
|
126
|
-
/>
|
|
127
|
-
<Field
|
|
128
|
-
v-else
|
|
129
|
-
v-model:field="newEmail"
|
|
130
|
-
label="New Email"
|
|
131
|
-
placeholder="Enter new email"
|
|
132
|
-
class="mn-b-thin bg-light pd-medium radius-small"
|
|
133
|
-
:disabled="isVerificationSent"
|
|
134
|
-
/>
|
|
135
|
-
<Button
|
|
136
|
-
v-if="!isEditingEmail && !isVerificationSent"
|
|
137
|
-
:submit="() => startEditing('email')"
|
|
138
|
-
class="mn-b-thin t-black bg-light w-100"
|
|
139
|
-
>
|
|
140
|
-
Change Email
|
|
141
|
-
</Button>
|
|
142
|
-
<Button
|
|
143
|
-
v-if="isEditingEmail && !isVerificationSent"
|
|
144
|
-
:submit="() => sendVerification('email', 'edit')"
|
|
145
|
-
class="mn-b-thin bg-main w-100"
|
|
146
|
-
>
|
|
147
|
-
Verify New Email
|
|
148
|
-
</Button>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
|
|
152
|
-
<!-- Verification code section -->
|
|
153
|
-
<div v-if="isVerificationSent" class="mn-b-semi">
|
|
154
|
-
<Field
|
|
155
|
-
v-model:field="verificationCode"
|
|
156
|
-
label="Verification Code"
|
|
157
|
-
placeholder="Enter the code"
|
|
158
|
-
class="mn-b-thin bg-light pd-medium radius-small"
|
|
159
|
-
/>
|
|
160
|
-
<div class="flex gap-2">
|
|
161
|
-
<Button
|
|
162
|
-
:submit="verifyCode"
|
|
163
|
-
class="mn-b-thin bg-main flex-child-1"
|
|
164
|
-
>
|
|
165
|
-
Verify
|
|
166
|
-
</Button>
|
|
167
|
-
<Button
|
|
168
|
-
:submit="resendCode"
|
|
169
|
-
class="mn-b-thin bg-light flex-child-1"
|
|
170
|
-
>
|
|
171
|
-
Resend Code
|
|
172
|
-
</Button>
|
|
173
|
-
<Button
|
|
174
|
-
:submit="cancelEdit"
|
|
175
|
-
class="mn-b-thin bg-red t-white flex-child-1"
|
|
176
|
-
>
|
|
177
|
-
Cancel
|
|
178
|
-
</Button>
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
</template>
|
|
183
|
-
|
|
184
|
-
<script setup>
|
|
185
|
-
// Import components
|
|
186
|
-
import Field from '@martyrs/src/components/Field/Field.vue'
|
|
187
|
-
import Button from '@martyrs/src/components/Button/Button.vue'
|
|
188
|
-
|
|
189
|
-
// Import libs
|
|
190
|
-
import { ref, onMounted } from 'vue'
|
|
191
|
-
import { useRoute, useRouter } from 'vue-router'
|
|
192
|
-
|
|
193
|
-
// Import state
|
|
194
|
-
import * as users from '@martyrs/src/modules/auth/views/store/users.js'
|
|
195
|
-
import * as twofa from '@martyrs/src/modules/auth/views/store/twofa.js'
|
|
196
|
-
|
|
197
|
-
// Component state
|
|
198
|
-
const show = ref(false)
|
|
199
|
-
const newEmail = ref('')
|
|
200
|
-
const newPhone = ref('')
|
|
201
|
-
const verificationCode = ref('')
|
|
202
|
-
const isVerificationSent = ref(false)
|
|
203
|
-
const currentVerificationType = ref(null)
|
|
204
|
-
const currentAction = ref(null) // 'add' or 'edit'
|
|
205
|
-
const isEditingEmail = ref(false)
|
|
206
|
-
const isEditingPhone = ref(false)
|
|
207
|
-
const isAddingEmail = ref(false)
|
|
208
|
-
const isAddingPhone = ref(false)
|
|
209
|
-
|
|
210
|
-
// Router
|
|
211
|
-
const route = useRoute()
|
|
212
|
-
const router = useRouter()
|
|
213
|
-
|
|
214
|
-
import FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'
|
|
215
|
-
|
|
216
|
-
// Lifecycle hooks
|
|
217
|
-
onMounted(async () => {
|
|
218
|
-
await users.actions.read({ _id: route.params._id })
|
|
219
|
-
show.value = true
|
|
220
|
-
})
|
|
221
|
-
|
|
222
|
-
// Methods
|
|
223
|
-
function startEditing(type) {
|
|
224
|
-
if (type === 'email') {
|
|
225
|
-
isEditingEmail.value = true
|
|
226
|
-
newEmail.value = ''
|
|
227
|
-
} else {
|
|
228
|
-
isEditingPhone.value = true
|
|
229
|
-
newPhone.value = ''
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// Methods for adding new contact info
|
|
234
|
-
function startAdding(type) {
|
|
235
|
-
if (type === 'email') {
|
|
236
|
-
isAddingEmail.value = true
|
|
237
|
-
newEmail.value = ''
|
|
238
|
-
} else {
|
|
239
|
-
isAddingPhone.value = true
|
|
240
|
-
newPhone.value = ''
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function cancelAdding(type) {
|
|
245
|
-
if (type === 'email') {
|
|
246
|
-
isAddingEmail.value = false
|
|
247
|
-
newEmail.value = ''
|
|
248
|
-
} else {
|
|
249
|
-
isAddingPhone.value = false
|
|
250
|
-
newPhone.value = ''
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function cancelEdit() {
|
|
255
|
-
isEditingEmail.value = false
|
|
256
|
-
isEditingPhone.value = false
|
|
257
|
-
isAddingEmail.value = false
|
|
258
|
-
isAddingPhone.value = false
|
|
259
|
-
isVerificationSent.value = false
|
|
260
|
-
verificationCode.value = ''
|
|
261
|
-
newEmail.value = ''
|
|
262
|
-
newPhone.value = ''
|
|
263
|
-
currentVerificationType.value = null
|
|
264
|
-
currentAction.value = null
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
async function sendVerification(type, action) {
|
|
268
|
-
try {
|
|
269
|
-
// Validate input before sending verification
|
|
270
|
-
if (action === 'edit') {
|
|
271
|
-
if (type === 'email' && (!newEmail.value || newEmail.value === users.state.current.email)) {
|
|
272
|
-
throw new Error('Please enter a different email address')
|
|
273
|
-
}
|
|
274
|
-
if (type === 'phone' && (!newPhone.value || newPhone.value === users.state.current.phone)) {
|
|
275
|
-
throw new Error('Please enter a different phone number')
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
const userData = {
|
|
280
|
-
phone: type === 'phone' ? newPhone.value : users.state.current.phone,
|
|
281
|
-
email: type === 'email' ? newEmail.value : users.state.current.email
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
await twofa.sendCode(userData, 'update', type)
|
|
285
|
-
isVerificationSent.value = true
|
|
286
|
-
currentVerificationType.value = type
|
|
287
|
-
currentAction.value = action
|
|
288
|
-
} catch (error) {
|
|
289
|
-
console.error('Failed to send verification code:', error)
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
async function verifyCode() {
|
|
294
|
-
try {
|
|
295
|
-
// Проверяем, что код существует в state
|
|
296
|
-
if (!twofa.state.code || !twofa.state.code.code) {
|
|
297
|
-
throw new Error('Verification code not found')
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// Сравниваем введенный код с кодом из state
|
|
301
|
-
if (String(twofa.state.code.code) === String(verificationCode.value)) {
|
|
302
|
-
const updateData = { ...users.state.current }
|
|
303
|
-
|
|
304
|
-
if (currentVerificationType.value === 'email') {
|
|
305
|
-
updateData.email = newEmail.value
|
|
306
|
-
} else {
|
|
307
|
-
updateData.phone = newPhone.value
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
await users.actions.update(updateData)
|
|
311
|
-
|
|
312
|
-
// Reset state
|
|
313
|
-
cancelEdit()
|
|
314
|
-
|
|
315
|
-
// Refresh user data
|
|
316
|
-
await users.actions.read({ _id: route.params._id })
|
|
317
|
-
} else {
|
|
318
|
-
throw new Error('Invalid verification code')
|
|
319
|
-
}
|
|
320
|
-
} catch (error) {
|
|
321
|
-
console.error('Verification failed:', error)
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
async function resendCode() {
|
|
326
|
-
verificationCode.value = ''
|
|
327
|
-
await sendVerification(currentVerificationType.value, currentAction.value)
|
|
328
|
-
}
|
|
329
|
-
</script>
|