@ozdao/martyrs 0.2.584 → 0.2.586
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 +161 -96
- package/dist/{authJwt-J1csaMWA.js → authJwt-DKbMMjw0.js} +33 -0
- package/dist/builder.js +2 -0
- package/dist/chats.server.js +2 -2
- package/dist/community.server.js +1 -1
- package/dist/core.server.js +191 -2
- 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 +2 -2
- package/dist/files.server.js +1 -1
- package/dist/gallery.server.js +1 -1
- package/dist/index-kvBwwb0w.js +427 -0
- package/dist/inventory.server.js +2 -2
- package/dist/{mailing-DuEFRsa3.js → mailing-DT7nbNjZ.js} +16 -3
- package/dist/{main-fmp55tJF.js → main-BIf-WirR.js} +864 -865
- package/dist/marketplace.server.js +1 -1
- package/dist/martyrs/dist/{main-fmp55tJF.js → main-BIf-WirR.js} +193 -38
- package/dist/martyrs/dist/main-BIf-WirR.js.map +1 -0
- package/dist/martyrs/dist/{web-BDuQSQKS.js → web-O7lXcjg0.js} +2 -2
- package/dist/martyrs/dist/{web-BDuQSQKS.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/EditImages/{EditImages.vue2.js → EditImages.vue.js} +2 -2
- package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -0
- 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 +1 -1
- package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -1
- package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.js → Spoiler.vue.js} +2 -2
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +1 -0
- package/dist/martyrs/src/components/Tab/{Tab.vue.js → Tab.vue2.js} +2 -2
- package/dist/martyrs/src/components/Tab/Tab.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/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 +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +104 -77
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.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 +71 -30
- 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 +3 -3
- 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 +87 -31
- 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/backoffice/backoffice.client.js +3 -15
- package/dist/martyrs/src/modules/backoffice/backoffice.client.js.map +1 -1
- package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js +99 -0
- package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js.map +1 -0
- package/dist/martyrs/src/modules/backoffice/{backoffice.router.js → router/backoffice.router.js} +9 -7
- package/dist/martyrs/src/modules/backoffice/router/backoffice.router.js.map +1 -0
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +7 -1
- package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
- package/dist/martyrs/src/modules/core/core.client.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/classes/core.app.js +5 -1
- package/dist/martyrs/src/modules/core/views/classes/core.app.js.map +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 +1 -1
- 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 +77 -67
- 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 +76 -7
- 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 +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +1 -0
- package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +1 -1
- package/dist/martyrs/src/modules/core/views/store/core.store.js +1 -0
- package/dist/martyrs/src/modules/core/views/store/core.store.js.map +1 -1
- package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js +2 -1
- package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js.map +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 +2 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js.map +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/sections/EditTickets.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 +1 -1
- 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 +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
- package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.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 +1 -1
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
- 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 +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
- 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 +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
- 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 +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/Orders.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/organizations/components/blocks/CardDepartment.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 +2 -2
- package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +4 -3
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
- 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 +1 -1
- 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/pages.router.js +7 -5
- package/dist/martyrs/src/modules/pages/pages.router.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/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 +2 -2
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -2
- 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 +3 -3
- package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +4 -4
- 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 +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
- 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 +2 -2
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +2 -2
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.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 +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.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/Spot.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 +1 -1
- 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 +1 -1
- package/dist/orders.server.js +7 -6
- package/dist/organizations.server.js +2 -2
- package/dist/products.server.js +2 -2
- package/dist/profile.schema-C31Lynn3.js +21 -0
- package/dist/rents.server.js +1 -1
- package/dist/sessions.service-COcwjd0f.js +86 -0
- package/dist/style.css +183 -108
- 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 +2 -2
- package/dist/{web-BDuQSQKS.js → web-O7lXcjg0.js} +1 -1
- package/package.json +5 -1
- package/src/builder/modes/ssr.rspack.dev.js +2 -0
- package/src/cli/commands/create.js +106 -0
- package/src/cli/index.js +25 -0
- package/src/cli/templates/app/.env.development.mustache +14 -0
- package/src/cli/templates/app/.env.production.mustache +14 -0
- package/src/cli/templates/app/Dockerfile +36 -0
- package/src/cli/templates/app/babel.config.js +14 -0
- package/src/cli/templates/app/env.js +3 -0
- package/src/cli/templates/app/index.js +46 -0
- package/src/cli/templates/app/mongodb.config.js +18 -0
- package/src/cli/templates/app/package.json.mustache +65 -0
- package/src/cli/templates/app/src/client.js +22 -0
- package/src/cli/templates/app/src/components/pages/Index.vue +11 -0
- package/src/cli/templates/app/src/configs/global.config.js.mustache +40 -0
- package/src/cli/templates/app/src/localization/extensions.js +2 -0
- package/src/cli/templates/app/src/localization/index.js +44 -0
- package/src/cli/templates/app/src/localization/overrides.js +2 -0
- package/src/cli/templates/app/src/localization/translations.js +10 -0
- package/src/cli/templates/app/src/models/index.js +9 -0
- package/src/cli/templates/app/src/router/index.js +48 -0
- package/src/cli/templates/app/src/scss/theme.scss +18 -0
- package/src/cli/templates/app/src/server.js +68 -0
- package/src/cli/templates/app/src/store/index.js +9 -0
- package/src/cli/templates/docker-compose.yaml.mustache +47 -0
- package/src/cli/templates/nginx/Dockerfile +5 -0
- package/src/cli/templates/nginx/default.conf.mustache +55 -0
- package/src/cli/templates/public/favicon/.gitkeep +0 -0
- package/src/cli/templates/start-dev.sh.mustache +131 -0
- package/src/cli/templates/start-prod.sh.mustache +12 -0
- 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 +4 -15
- 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 +51 -18
- 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/backoffice/backoffice.client.js +1 -25
- package/src/modules/backoffice/configs/navigation.backoffice.config.js +99 -0
- package/src/modules/backoffice/router/backoffice.router.js +8 -7
- package/src/modules/community/components/pages/BlogPost.vue +9 -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.client.js +1 -0
- package/src/modules/core/core.server.js +45 -3
- 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/classes/core.app.js +8 -3
- 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 +444 -479
- package/src/modules/core/views/components/pages/404.vue +55 -3
- package/src/modules/core/views/store/core.store.js +1 -0
- package/src/modules/core/views/utils/vue-app-renderer.js +9 -1
- package/src/modules/orders/controllers/orders.controller.js +3 -3
- package/src/modules/pages/pages.router.js +4 -2
- package/src/modules/pages/views/router/pages.backoffice.router.js +4 -3
- package/src/modules/products/components/pages/Products.vue +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-fmp55tJF.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/EditImages/EditImages.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +0 -1
- package/dist/martyrs/src/components/Tab/Tab.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/backoffice/backoffice.router.js.map +0 -1
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js +0 -150
- package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js.map +0 -1
- package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.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
- package/src/modules/backoffice/backoffice.router.js +0 -69
- package/src/modules/backoffice/components/partials/Sidebar.vue +0 -165
|
@@ -1,13 +1,35 @@
|
|
|
1
|
-
import { createElementBlock, openBlock,
|
|
2
|
-
import _sfc_main$
|
|
3
|
-
import _sfc_main$
|
|
4
|
-
import
|
|
1
|
+
import { ref, createElementBlock, openBlock, createElementVNode, createVNode, createBlock, withCtx, createTextVNode, unref } from "vue";
|
|
2
|
+
import _sfc_main$3 from "../../../../../components/Checkbox/Checkbox.vue.js";
|
|
3
|
+
import _sfc_main$2 from "../../../../../components/Button/Button.vue.js";
|
|
4
|
+
import Field from "../../../../../components/Field/Field.vue.js";
|
|
5
|
+
import _sfc_main$1 from "../../../../../components/FieldPhone/FieldPhone.vue.js";
|
|
5
6
|
import { useRouter } from "vue-router";
|
|
6
7
|
import { actions as actions$1 } from "../../store/auth.js";
|
|
7
|
-
import {
|
|
8
|
-
import { useStore } from "../../../../core/views/store/core.store.js";
|
|
8
|
+
import { state, actions } from "../../store/users.js";
|
|
9
|
+
import { useStore, setError } from "../../../../core/views/store/core.store.js";
|
|
10
|
+
import { withOtp } from "../../plugins/otp.plugin.js";
|
|
11
|
+
import $axios from "../../../../core/views/utils/axios-instance.js";
|
|
9
12
|
const _hoisted_1 = { class: "for-transition w-100" };
|
|
10
13
|
const _hoisted_2 = { class: "bg-white mn-b-thin" };
|
|
14
|
+
const _hoisted_3 = { class: "mn-b-semi" };
|
|
15
|
+
const _hoisted_4 = {
|
|
16
|
+
key: 3,
|
|
17
|
+
class: "flex gap-1"
|
|
18
|
+
};
|
|
19
|
+
const _hoisted_5 = {
|
|
20
|
+
key: 4,
|
|
21
|
+
class: "flex gap-2"
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_6 = { class: "mn-b-semi" };
|
|
24
|
+
const _hoisted_7 = {
|
|
25
|
+
key: 3,
|
|
26
|
+
class: "flex gap-1"
|
|
27
|
+
};
|
|
28
|
+
const _hoisted_8 = {
|
|
29
|
+
key: 4,
|
|
30
|
+
class: "flex gap-2"
|
|
31
|
+
};
|
|
32
|
+
const _hoisted_9 = { class: "bg-white mn-b-thin" };
|
|
11
33
|
const _sfc_main = {
|
|
12
34
|
__name: "ProfileEditAccount",
|
|
13
35
|
props: {
|
|
@@ -20,6 +42,43 @@ const _sfc_main = {
|
|
|
20
42
|
const store = useStore();
|
|
21
43
|
const core = store.core;
|
|
22
44
|
const router = useRouter();
|
|
45
|
+
const isEditingPhone = ref(false);
|
|
46
|
+
const isEditingEmail = ref(false);
|
|
47
|
+
const newPhone = ref("");
|
|
48
|
+
const newEmail = ref("");
|
|
49
|
+
async function savePhone() {
|
|
50
|
+
if (!newPhone.value) return;
|
|
51
|
+
try {
|
|
52
|
+
const result = await withOtp(
|
|
53
|
+
(data) => $axios.put(`/api/users/${state.current._id}/phone`, data),
|
|
54
|
+
{ phone: newPhone.value }
|
|
55
|
+
);
|
|
56
|
+
if (result.data) {
|
|
57
|
+
state.current.phone = result.data.phone;
|
|
58
|
+
}
|
|
59
|
+
isEditingPhone.value = false;
|
|
60
|
+
newPhone.value = "";
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.log("savePhone catch:", error);
|
|
63
|
+
setError(error);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function saveEmail() {
|
|
67
|
+
if (!newEmail.value) return;
|
|
68
|
+
try {
|
|
69
|
+
const result = await withOtp(
|
|
70
|
+
(data) => $axios.put(`/api/users/${state.current._id}/email`, data),
|
|
71
|
+
{ email: newEmail.value }
|
|
72
|
+
);
|
|
73
|
+
if (result.data) {
|
|
74
|
+
state.current.email = result.data.email;
|
|
75
|
+
}
|
|
76
|
+
isEditingEmail.value = false;
|
|
77
|
+
newEmail.value = "";
|
|
78
|
+
} catch (error) {
|
|
79
|
+
setError(error);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
23
82
|
async function onSubmit() {
|
|
24
83
|
await actions.update(state.current);
|
|
25
84
|
}
|
|
@@ -35,32 +94,157 @@ const _sfc_main = {
|
|
|
35
94
|
}
|
|
36
95
|
return (_ctx, _cache) => {
|
|
37
96
|
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
38
|
-
createVNode(_sfc_main$1, { class: "bg-white mn-b-thin" }),
|
|
39
97
|
createElementVNode("div", _hoisted_2, [
|
|
40
|
-
_cache[
|
|
41
|
-
|
|
98
|
+
_cache[13] || (_cache[13] = createElementVNode("h3", { class: "mn-b-small" }, "Phone and Email", -1)),
|
|
99
|
+
createElementVNode("div", _hoisted_3, [
|
|
100
|
+
state.current.phone && !isEditingPhone.value ? (openBlock(), createBlock(Field, {
|
|
101
|
+
key: 0,
|
|
102
|
+
field: state.current.phone,
|
|
103
|
+
"onUpdate:field": _cache[0] || (_cache[0] = ($event) => state.current.phone = $event),
|
|
104
|
+
label: "Phone",
|
|
105
|
+
class: "mn-b-thin bg-light pd-medium radius-small",
|
|
106
|
+
disabled: ""
|
|
107
|
+
}, null, 8, ["field"])) : (openBlock(), createBlock(_sfc_main$1, {
|
|
108
|
+
key: 1,
|
|
109
|
+
onChange: _cache[1] || (_cache[1] = (val) => newPhone.value = val),
|
|
110
|
+
dropdownOptions: {
|
|
111
|
+
showDialCodeInSelection: true,
|
|
112
|
+
showFlags: true,
|
|
113
|
+
showDialCodeInList: true
|
|
114
|
+
},
|
|
115
|
+
validCharactersOnly: true,
|
|
116
|
+
mode: "national",
|
|
117
|
+
inputOptions: { placeholder: "Enter phone number", type: "tel" },
|
|
118
|
+
class: "bg-light h-4r pd-small radius-small mn-b-thin"
|
|
119
|
+
})),
|
|
120
|
+
state.current.phone && !isEditingPhone.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
121
|
+
key: 2,
|
|
122
|
+
submit: () => isEditingPhone.value = true,
|
|
123
|
+
class: "mn-b-thin t-black bg-light w-100"
|
|
124
|
+
}, {
|
|
125
|
+
default: withCtx(() => _cache[5] || (_cache[5] = [
|
|
126
|
+
createTextVNode(" Change Phone ")
|
|
127
|
+
])),
|
|
128
|
+
_: 1
|
|
129
|
+
}, 8, ["submit"])) : !state.current.phone ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
130
|
+
createVNode(_sfc_main$2, {
|
|
131
|
+
submit: () => savePhone(),
|
|
132
|
+
class: "mn-b-thin bg-main w-100"
|
|
133
|
+
}, {
|
|
134
|
+
default: withCtx(() => _cache[6] || (_cache[6] = [
|
|
135
|
+
createTextVNode(" Save Phone ")
|
|
136
|
+
])),
|
|
137
|
+
_: 1
|
|
138
|
+
}, 8, ["submit"])
|
|
139
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
140
|
+
createVNode(_sfc_main$2, {
|
|
141
|
+
submit: () => savePhone(),
|
|
142
|
+
class: "mn-b-thin bg-main flex-child-1"
|
|
143
|
+
}, {
|
|
144
|
+
default: withCtx(() => _cache[7] || (_cache[7] = [
|
|
145
|
+
createTextVNode(" Save Phone ")
|
|
146
|
+
])),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 8, ["submit"]),
|
|
149
|
+
createVNode(_sfc_main$2, {
|
|
150
|
+
submit: () => {
|
|
151
|
+
isEditingPhone.value = false;
|
|
152
|
+
newPhone.value = "";
|
|
153
|
+
},
|
|
154
|
+
class: "mn-b-thin bg-red t-white flex-child-1"
|
|
155
|
+
}, {
|
|
156
|
+
default: withCtx(() => _cache[8] || (_cache[8] = [
|
|
157
|
+
createTextVNode(" Cancel ")
|
|
158
|
+
])),
|
|
159
|
+
_: 1
|
|
160
|
+
}, 8, ["submit"])
|
|
161
|
+
]))
|
|
162
|
+
]),
|
|
163
|
+
createElementVNode("div", _hoisted_6, [
|
|
164
|
+
state.current.email && !isEditingEmail.value ? (openBlock(), createBlock(Field, {
|
|
165
|
+
key: 0,
|
|
166
|
+
field: state.current.email,
|
|
167
|
+
"onUpdate:field": _cache[2] || (_cache[2] = ($event) => state.current.email = $event),
|
|
168
|
+
label: "Email",
|
|
169
|
+
class: "mn-b-thin bg-light pd-medium radius-small",
|
|
170
|
+
disabled: ""
|
|
171
|
+
}, null, 8, ["field"])) : (openBlock(), createBlock(Field, {
|
|
172
|
+
key: 1,
|
|
173
|
+
field: newEmail.value,
|
|
174
|
+
"onUpdate:field": _cache[3] || (_cache[3] = ($event) => newEmail.value = $event),
|
|
175
|
+
label: "Email",
|
|
176
|
+
placeholder: "Enter email",
|
|
177
|
+
class: "mn-b-thin bg-light pd-medium radius-small"
|
|
178
|
+
}, null, 8, ["field"])),
|
|
179
|
+
state.current.email && !isEditingEmail.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
180
|
+
key: 2,
|
|
181
|
+
submit: () => isEditingEmail.value = true,
|
|
182
|
+
class: "mn-b-thin t-black bg-light w-100"
|
|
183
|
+
}, {
|
|
184
|
+
default: withCtx(() => _cache[9] || (_cache[9] = [
|
|
185
|
+
createTextVNode(" Change Email ")
|
|
186
|
+
])),
|
|
187
|
+
_: 1
|
|
188
|
+
}, 8, ["submit"])) : !state.current.email ? (openBlock(), createElementBlock("div", _hoisted_7, [
|
|
189
|
+
createVNode(_sfc_main$2, {
|
|
190
|
+
submit: () => saveEmail(),
|
|
191
|
+
class: "mn-b-thin bg-main w-100"
|
|
192
|
+
}, {
|
|
193
|
+
default: withCtx(() => _cache[10] || (_cache[10] = [
|
|
194
|
+
createTextVNode(" Save Email ")
|
|
195
|
+
])),
|
|
196
|
+
_: 1
|
|
197
|
+
}, 8, ["submit"])
|
|
198
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
199
|
+
createVNode(_sfc_main$2, {
|
|
200
|
+
submit: () => saveEmail(),
|
|
201
|
+
class: "mn-b-thin bg-main flex-child-1"
|
|
202
|
+
}, {
|
|
203
|
+
default: withCtx(() => _cache[11] || (_cache[11] = [
|
|
204
|
+
createTextVNode(" Save Email ")
|
|
205
|
+
])),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, ["submit"]),
|
|
208
|
+
createVNode(_sfc_main$2, {
|
|
209
|
+
submit: () => {
|
|
210
|
+
isEditingEmail.value = false;
|
|
211
|
+
newEmail.value = "";
|
|
212
|
+
},
|
|
213
|
+
class: "mn-b-thin bg-red t-white flex-child-1"
|
|
214
|
+
}, {
|
|
215
|
+
default: withCtx(() => _cache[12] || (_cache[12] = [
|
|
216
|
+
createTextVNode(" Cancel ")
|
|
217
|
+
])),
|
|
218
|
+
_: 1
|
|
219
|
+
}, 8, ["submit"])
|
|
220
|
+
]))
|
|
221
|
+
])
|
|
222
|
+
]),
|
|
223
|
+
createElementVNode("div", _hoisted_9, [
|
|
224
|
+
_cache[14] || (_cache[14] = createElementVNode("h3", { class: "mn-b-small" }, "Settings", -1)),
|
|
225
|
+
createVNode(_sfc_main$3, {
|
|
42
226
|
label: "Darkmode",
|
|
43
227
|
radio: unref(core).state.theme.mode === "dark",
|
|
44
|
-
"onUpdate:radio": _cache[
|
|
228
|
+
"onUpdate:radio": _cache[4] || (_cache[4] = () => unref(core).actions.toggleTheme()),
|
|
45
229
|
class: "w-100 bg-light t-black pd-medium radius-small"
|
|
46
230
|
}, null, 8, ["radio"])
|
|
47
231
|
]),
|
|
48
|
-
createVNode(_sfc_main$
|
|
232
|
+
createVNode(_sfc_main$2, {
|
|
49
233
|
submit: onSubmit,
|
|
50
234
|
callback: redirectTo,
|
|
51
235
|
class: "mn-b-thin bg-main w-100"
|
|
52
236
|
}, {
|
|
53
|
-
default: withCtx(() => _cache[
|
|
237
|
+
default: withCtx(() => _cache[15] || (_cache[15] = [
|
|
54
238
|
createTextVNode(" Save ")
|
|
55
239
|
])),
|
|
56
240
|
_: 1
|
|
57
241
|
}),
|
|
58
|
-
createVNode(_sfc_main$
|
|
242
|
+
createVNode(_sfc_main$2, {
|
|
59
243
|
submit: onSubmitDelete,
|
|
60
244
|
callback: () => unref(router).push({ name: "Sign In" }),
|
|
61
245
|
class: "mn-b-thin w-100 bg-red t-white"
|
|
62
246
|
}, {
|
|
63
|
-
default: withCtx(() => _cache[
|
|
247
|
+
default: withCtx(() => _cache[16] || (_cache[16] = [
|
|
64
248
|
createTextVNode(" Delete Account ")
|
|
65
249
|
])),
|
|
66
250
|
_: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileEditAccount.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/ProfileEditAccount.vue"],"sourcesContent":["<template>\n <div class=\"for-transition w-100\">\n <
|
|
1
|
+
{"version":3,"file":"ProfileEditAccount.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/ProfileEditAccount.vue"],"sourcesContent":["<template>\n <div class=\"for-transition w-100\">\n <!-- Phone and Email -->\n <div class=\"bg-white mn-b-thin\">\n <h3 class=\"mn-b-small\">Phone and Email</h3>\n\n <!-- Phone -->\n <div class=\"mn-b-semi\">\n <Field\n v-if=\"users.state.current.phone && !isEditingPhone\"\n v-model:field=\"users.state.current.phone\"\n label=\"Phone\"\n class=\"mn-b-thin bg-light pd-medium radius-small\"\n disabled\n />\n <FieldPhone\n v-else\n @change=\"(val) => newPhone = val\"\n :dropdownOptions=\"{\n showDialCodeInSelection: true,\n showFlags: true,\n showDialCodeInList: true\n }\"\n :validCharactersOnly=\"true\"\n mode=\"national\"\n :inputOptions=\"{ placeholder: 'Enter phone number', type: 'tel' }\"\n class=\"bg-light h-4r pd-small radius-small mn-b-thin\"\n />\n <Button\n v-if=\"users.state.current.phone && !isEditingPhone\"\n :submit=\"() => isEditingPhone = true\"\n class=\"mn-b-thin t-black bg-light w-100\"\n >\n Change Phone\n </Button>\n <div v-else-if=\"!users.state.current.phone\" class=\"flex gap-1\">\n <Button\n :submit=\"() => savePhone()\"\n class=\"mn-b-thin bg-main w-100\"\n >\n Save Phone\n </Button>\n </div>\n <div v-else class=\"flex gap-2\">\n <Button\n :submit=\"() => savePhone()\"\n class=\"mn-b-thin bg-main flex-child-1\"\n >\n Save Phone\n </Button>\n <Button\n :submit=\"() => { isEditingPhone = false; newPhone = '' }\"\n class=\"mn-b-thin bg-red t-white flex-child-1\"\n >\n Cancel\n </Button>\n </div>\n </div>\n\n <!-- Email -->\n <div class=\"mn-b-semi\">\n <Field\n v-if=\"users.state.current.email && !isEditingEmail\"\n v-model:field=\"users.state.current.email\"\n label=\"Email\"\n class=\"mn-b-thin bg-light pd-medium radius-small\"\n disabled\n />\n <Field\n v-else\n v-model:field=\"newEmail\"\n label=\"Email\"\n placeholder=\"Enter email\"\n class=\"mn-b-thin bg-light pd-medium radius-small\"\n />\n <Button\n v-if=\"users.state.current.email && !isEditingEmail\"\n :submit=\"() => isEditingEmail = true\"\n class=\"mn-b-thin t-black bg-light w-100\"\n >\n Change Email\n </Button>\n <div v-else-if=\"!users.state.current.email\" class=\"flex gap-1\">\n <Button\n :submit=\"() => saveEmail()\"\n class=\"mn-b-thin bg-main w-100\"\n >\n Save Email\n </Button>\n </div>\n <div v-else class=\"flex gap-2\">\n <Button\n :submit=\"() => saveEmail()\"\n class=\"mn-b-thin bg-main flex-child-1\"\n >\n Save Email\n </Button>\n <Button\n :submit=\"() => { isEditingEmail = false; newEmail = '' }\"\n class=\"mn-b-thin bg-red t-white flex-child-1\"\n >\n Cancel\n </Button>\n </div>\n </div>\n </div>\n\n <!-- Settings -->\n <div class=\"bg-white mn-b-thin\">\n <h3 class=\"mn-b-small\">Settings</h3>\n <Checkbox\n :label=\"'Darkmode'\"\n :radio=\"core.state.theme.mode === 'dark'\"\n @update:radio=\"() => core.actions.toggleTheme()\"\n class=\"w-100 bg-light t-black pd-medium radius-small\"\n />\n </div>\n\n <Button\n :submit=\"onSubmit\"\n :callback=\"redirectTo\"\n class=\"mn-b-thin bg-main w-100\"\n >\n Save\n </Button>\n\n <Button\n :submit=\"onSubmitDelete\"\n :callback=\"() => router.push({ name: 'Sign In' })\"\n class=\"mn-b-thin w-100 bg-red t-white\"\n >\n Delete Account\n </Button>\n </div>\n</template>\n\n<script setup>\nimport Checkbox from '@martyrs/src/components/Checkbox/Checkbox.vue'\nimport Button from '@martyrs/src/components/Button/Button.vue'\nimport Field from '@martyrs/src/components/Field/Field.vue'\nimport FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'\n\nimport { ref } from 'vue'\nimport { useRouter } from 'vue-router'\n\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js'\nimport * as users from '@martyrs/src/modules/auth/views/store/users.js'\nimport { useStore, setError } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport { withOtp } from '@martyrs/src/modules/auth/views/plugins/otp.plugin.js'\nimport $axios from '@martyrs/src/modules/core/views/utils/axios-instance.js'\n\nconst store = useStore()\nconst core = store.core\nconst router = useRouter()\n\nconst isEditingPhone = ref(false)\nconst isEditingEmail = ref(false)\nconst newPhone = ref('')\nconst newEmail = ref('')\n\ndefineProps({\n userData: {\n type: Object,\n required: true\n }\n})\n\nasync function savePhone() {\n if (!newPhone.value) return\n\n try {\n const result = await withOtp(\n (data) => $axios.put(`/api/users/${users.state.current._id}/phone`, data),\n { phone: newPhone.value }\n )\n\n if (result.data) {\n users.state.current.phone = result.data.phone\n }\n\n isEditingPhone.value = false\n newPhone.value = ''\n } catch (error) {\n console.log('savePhone catch:', error)\n setError(error)\n }\n}\n\nasync function saveEmail() {\n if (!newEmail.value) return\n\n try {\n const result = await withOtp(\n (data) => $axios.put(`/api/users/${users.state.current._id}/email`, data),\n { email: newEmail.value }\n )\n\n if (result.data) {\n users.state.current.email = result.data.email\n }\n\n isEditingEmail.value = false\n newEmail.value = ''\n } catch (error) {\n setError(error)\n }\n}\n\nasync function onSubmit() {\n await users.actions.update(users.state.current)\n}\n\nasync function onSubmitDelete() {\n const confirmation = window.confirm(\"Are you sure you want to delete your account? Restoration will be possible only with the help of an administrator.\")\n\n if (!confirmation) return\n\n users.state.current.status = 'removed'\n await users.actions.update(users.state.current)\n auth.actions.logout()\n}\n\nfunction redirectTo() {\n router.back()\n}\n</script>\n"],"names":["users.state","users.actions","auth.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJA,UAAM,QAAQ,SAAQ;AACtB,UAAM,OAAO,MAAM;AACnB,UAAM,SAAS,UAAS;AAExB,UAAM,iBAAiB,IAAI,KAAK;AAChC,UAAM,iBAAiB,IAAI,KAAK;AAChC,UAAM,WAAW,IAAI,EAAE;AACvB,UAAM,WAAW,IAAI,EAAE;AASvB,mBAAe,YAAY;AACzB,UAAI,CAAC,SAAS,MAAO;AAErB,UAAI;AACF,cAAM,SAAS,MAAM;AAAA,UACnB,CAAC,SAAS,OAAO,IAAI,cAAcA,MAAY,QAAQ,GAAG,UAAU,IAAI;AAAA,UACxE,EAAE,OAAO,SAAS,MAAK;AAAA,QAC7B;AAEI,YAAI,OAAO,MAAM;AACfA,gBAAY,QAAQ,QAAQ,OAAO,KAAK;AAAA,QAC1C;AAEA,uBAAe,QAAQ;AACvB,iBAAS,QAAQ;AAAA,MACnB,SAAS,OAAO;AACd,gBAAQ,IAAI,oBAAoB,KAAK;AACrC,iBAAS,KAAK;AAAA,MAChB;AAAA,IACF;AAEA,mBAAe,YAAY;AACzB,UAAI,CAAC,SAAS,MAAO;AAErB,UAAI;AACF,cAAM,SAAS,MAAM;AAAA,UACnB,CAAC,SAAS,OAAO,IAAI,cAAcA,MAAY,QAAQ,GAAG,UAAU,IAAI;AAAA,UACxE,EAAE,OAAO,SAAS,MAAK;AAAA,QAC7B;AAEI,YAAI,OAAO,MAAM;AACfA,gBAAY,QAAQ,QAAQ,OAAO,KAAK;AAAA,QAC1C;AAEA,uBAAe,QAAQ;AACvB,iBAAS,QAAQ;AAAA,MACnB,SAAS,OAAO;AACd,iBAAS,KAAK;AAAA,MAChB;AAAA,IACF;AAEA,mBAAe,WAAW;AACxB,YAAMC,QAAc,OAAOD,MAAY,OAAO;AAAA,IAChD;AAEA,mBAAe,iBAAiB;AAC9B,YAAM,eAAe,OAAO,QAAQ,oHAAoH;AAExJ,UAAI,CAAC,aAAc;AAEnBA,YAAY,QAAQ,SAAS;AAC7B,YAAMC,QAAc,OAAOD,MAAY,OAAO;AAC9CE,gBAAa,OAAM;AAAA,IACrB;AAEA,aAAS,aAAa;AACpB,aAAO,KAAI;AAAA,IACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createElementBlock, openBlock, createElementVNode, createVNode, toDisplayString, withCtx, createTextVNode } from "vue";
|
|
2
2
|
import Field from "../../../../../components/Field/Field.vue.js";
|
|
3
|
-
import _sfc_main$1 from "../../../../../components/Button/Button.
|
|
3
|
+
import _sfc_main$1 from "../../../../../components/Button/Button.vue.js";
|
|
4
4
|
import UploadImage from "../../../../../components/UploadImage/UploadImage.vue.js";
|
|
5
5
|
import { useRouter } from "vue-router";
|
|
6
6
|
import { state, actions } from "../../store/users.js";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ref, computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, createVNode, toDisplayString, unref, Transition, withCtx, createTextVNode } from "vue";
|
|
2
|
-
import _sfc_main$1 from "../../../../../components/Tab/Tab.
|
|
2
|
+
import _sfc_main$1 from "../../../../../components/Tab/Tab.vue2.js";
|
|
3
3
|
import Field from "../../../../../components/Field/Field.vue.js";
|
|
4
4
|
import _sfc_main$2 from "../../../../../components/FieldPhone/FieldPhone.vue.js";
|
|
5
|
-
import _sfc_main$3 from "../../../../../components/Button/Button.
|
|
6
|
-
import {
|
|
5
|
+
import _sfc_main$3 from "../../../../../components/Button/Button.vue.js";
|
|
6
|
+
import { useRouter } from "vue-router";
|
|
7
7
|
import { useI18n } from "vue-i18n";
|
|
8
|
-
import { useStore } from "../../../../core/views/store/core.store.js";
|
|
9
|
-
import {
|
|
8
|
+
import { useStore, setError } from "../../../../core/views/store/core.store.js";
|
|
9
|
+
import { withOtp } from "../../plugins/otp.plugin.js";
|
|
10
|
+
import $axios from "../../../../core/views/utils/axios-instance.js";
|
|
11
|
+
import { validateInputs, validatePhone, validateEmail, validatePassword } from "../../validations/inputs.validation.js";
|
|
10
12
|
/* empty css */
|
|
11
13
|
const _hoisted_1 = { class: "t-left pd-medium" };
|
|
12
14
|
const _hoisted_2 = { class: "mn-b-small" };
|
|
@@ -26,20 +28,21 @@ const _hoisted_8 = {
|
|
|
26
28
|
class: "mn-b-semi radius-small o-hidden"
|
|
27
29
|
};
|
|
28
30
|
const _hoisted_9 = { class: "mn-b-small t-transp" };
|
|
31
|
+
const _hoisted_10 = { class: "mn-b-semi" };
|
|
29
32
|
const _sfc_main = {
|
|
30
33
|
__name: "ResetPassword",
|
|
31
34
|
setup(__props) {
|
|
32
35
|
const store = useStore();
|
|
33
|
-
const auth = store.auth || { state: {}, actions: {} };
|
|
34
|
-
store.twofa || {};
|
|
35
36
|
const core = store.core || { state: {} };
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
});
|
|
37
|
+
const auth = store.auth;
|
|
38
|
+
const router = useRouter();
|
|
39
|
+
const { t } = useI18n({ useScope: "global" });
|
|
40
|
+
const identifier = ref("");
|
|
41
|
+
const password = ref("");
|
|
42
|
+
const passwordRepeat = ref("");
|
|
39
43
|
const phoneValidation = ref(null);
|
|
40
44
|
const emailValidation = ref(null);
|
|
41
|
-
|
|
42
|
-
const router = useRouter();
|
|
45
|
+
const passwordValidation = ref(null);
|
|
43
46
|
const availableTabs = computed(() => {
|
|
44
47
|
const tabs = [
|
|
45
48
|
{ name: t("auth.resetPassword.phone"), value: "phone" },
|
|
@@ -50,32 +53,54 @@ const _sfc_main = {
|
|
|
50
53
|
});
|
|
51
54
|
const tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : "");
|
|
52
55
|
async function onSubmit() {
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
if (tabAuth.value === "phone") {
|
|
57
|
+
await validateInputs(
|
|
55
58
|
phoneValidation,
|
|
56
59
|
validatePhone,
|
|
57
|
-
|
|
60
|
+
identifier.value,
|
|
58
61
|
"Некорректный телефон"
|
|
59
62
|
);
|
|
60
|
-
|
|
63
|
+
}
|
|
64
|
+
if (tabAuth.value === "email") {
|
|
65
|
+
await validateInputs(
|
|
61
66
|
emailValidation,
|
|
62
67
|
validateEmail,
|
|
63
|
-
|
|
68
|
+
identifier.value,
|
|
64
69
|
"Некорректный email"
|
|
65
70
|
);
|
|
66
|
-
}
|
|
67
|
-
|
|
71
|
+
}
|
|
72
|
+
await validateInputs(
|
|
73
|
+
passwordValidation,
|
|
74
|
+
validatePassword,
|
|
75
|
+
password.value,
|
|
76
|
+
"Некорректный пароль"
|
|
77
|
+
);
|
|
78
|
+
if (password.value !== passwordRepeat.value) {
|
|
79
|
+
setError({ response: { data: { errorCode: "PASSWORDS_DO_NOT_MATCH" } } });
|
|
80
|
+
throw new Error("PASSWORDS_DO_NOT_MATCH");
|
|
68
81
|
}
|
|
69
82
|
try {
|
|
70
|
-
await
|
|
83
|
+
const result = await withOtp(
|
|
84
|
+
(data) => $axios.post("/api/auth/reset-password", data),
|
|
85
|
+
{
|
|
86
|
+
identifier: identifier.value,
|
|
87
|
+
type: tabAuth.value,
|
|
88
|
+
password: password.value
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
if (result.data?.accessToken) {
|
|
92
|
+
const Cookies = (await import("../../../../../../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.js")).default;
|
|
93
|
+
Cookies.set("user", JSON.stringify(result.data), { path: "/", expires: 7 });
|
|
94
|
+
await auth.actions.initialize();
|
|
95
|
+
router.push({ name: "User Profile", params: { _id: result.data._id } });
|
|
96
|
+
} else {
|
|
97
|
+
router.push({ name: "Sign In" });
|
|
98
|
+
}
|
|
71
99
|
} catch (error) {
|
|
72
|
-
|
|
73
|
-
throw
|
|
100
|
+
setError(error);
|
|
101
|
+
throw error;
|
|
74
102
|
}
|
|
75
103
|
}
|
|
76
|
-
function redirectTo() {
|
|
77
|
-
router.push({ name: "Enter Code", query: { type: tabAuth.value, method: "reset-password" } });
|
|
78
|
-
}
|
|
79
104
|
return (_ctx, _cache) => {
|
|
80
105
|
return openBlock(), createElementBlock("section", _hoisted_1, [
|
|
81
106
|
createElementVNode("h3", _hoisted_2, toDisplayString(unref(t)("auth.resetPassword.forgotPasswordTitle")), 1),
|
|
@@ -94,7 +119,7 @@ const _sfc_main = {
|
|
|
94
119
|
tabAuth.value === "phone" ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
95
120
|
createElementVNode("p", _hoisted_7, toDisplayString(unref(t)("auth.resetPassword.smsInfo")), 1),
|
|
96
121
|
createVNode(_sfc_main$2, {
|
|
97
|
-
onChange: _cache[1] || (_cache[1] = (event) =>
|
|
122
|
+
onChange: _cache[1] || (_cache[1] = (event) => identifier.value = event),
|
|
98
123
|
dropdownOptions: {
|
|
99
124
|
showDialCodeInSelection: true,
|
|
100
125
|
showFlags: true,
|
|
@@ -114,8 +139,8 @@ const _sfc_main = {
|
|
|
114
139
|
tabAuth.value === "email" ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
115
140
|
createElementVNode("p", _hoisted_9, toDisplayString(unref(t)("auth.resetPassword.emailInfo")), 1),
|
|
116
141
|
createVNode(Field, {
|
|
117
|
-
field:
|
|
118
|
-
"onUpdate:field": _cache[2] || (_cache[2] = ($event) =>
|
|
142
|
+
field: identifier.value,
|
|
143
|
+
"onUpdate:field": _cache[2] || (_cache[2] = ($event) => identifier.value = $event),
|
|
119
144
|
placeholder: unref(t)("auth.resetPassword.emailPlaceholder"),
|
|
120
145
|
validation: emailValidation.value,
|
|
121
146
|
class: "bg-light h-4r pd-medium radius-small"
|
|
@@ -125,13 +150,29 @@ const _sfc_main = {
|
|
|
125
150
|
_: 1
|
|
126
151
|
})
|
|
127
152
|
]),
|
|
153
|
+
createElementVNode("div", _hoisted_10, [
|
|
154
|
+
createVNode(Field, {
|
|
155
|
+
field: password.value,
|
|
156
|
+
"onUpdate:field": _cache[3] || (_cache[3] = ($event) => password.value = $event),
|
|
157
|
+
type: "password",
|
|
158
|
+
placeholder: unref(t)("auth.enterPassword.passwordPlaceholder"),
|
|
159
|
+
validation: passwordValidation.value,
|
|
160
|
+
class: "bg-light pd-small radius-small mn-b-thin"
|
|
161
|
+
}, null, 8, ["field", "placeholder", "validation"]),
|
|
162
|
+
createVNode(Field, {
|
|
163
|
+
field: passwordRepeat.value,
|
|
164
|
+
"onUpdate:field": _cache[4] || (_cache[4] = ($event) => passwordRepeat.value = $event),
|
|
165
|
+
type: "password",
|
|
166
|
+
placeholder: unref(t)("auth.enterPassword.repeatPasswordPlaceholder"),
|
|
167
|
+
class: "bg-light pd-small radius-small"
|
|
168
|
+
}, null, 8, ["field", "placeholder"])
|
|
169
|
+
]),
|
|
128
170
|
createVNode(_sfc_main$3, {
|
|
129
171
|
submit: onSubmit,
|
|
130
|
-
callback: redirectTo,
|
|
131
172
|
class: "w-100 bg-main"
|
|
132
173
|
}, {
|
|
133
174
|
default: withCtx(() => [
|
|
134
|
-
createTextVNode(toDisplayString(unref(t)("auth.
|
|
175
|
+
createTextVNode(toDisplayString(unref(t)("auth.enterPassword.changePasswordBtn")), 1)
|
|
135
176
|
]),
|
|
136
177
|
_: 1
|
|
137
178
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResetPassword.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/ResetPassword.vue"],"sourcesContent":["<template>\n
|
|
1
|
+
{"version":3,"file":"ResetPassword.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/ResetPassword.vue"],"sourcesContent":["<template>\n <section class=\"t-left pd-medium\">\n <h3 class=\"mn-b-small\">{{ t('auth.resetPassword.forgotPasswordTitle') }}</h3>\n <p class=\"mn-b-small t-transp\">{{ t('auth.resetPassword.instructions') }}</p>\n\n <!-- Tab selector -->\n <div\n v-if=\"availableTabs.length > 1\"\n class=\"mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden\"\n >\n <Tab\n v-model:selected=\"tabAuth\"\n :tabs=\"availableTabs\"\n classTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n />\n </div>\n\n <!-- Form -->\n <div class=\"pos-relative\">\n <!-- Phone -->\n <transition name=\"slide-fade\">\n <div v-if=\"tabAuth === 'phone'\" class=\"mn-b-semi radius-small\">\n <p class=\"mn-b-small t-transp\">{{ t('auth.resetPassword.smsInfo') }}</p>\n <FieldPhone\n @change=\"(event) => identifier = event\"\n :dropdownOptions=\"{\n showDialCodeInSelection: true,\n showFlags: true,\n showDialCodeInList: true\n }\"\n :validation=\"phoneValidation\"\n mode=\"national\"\n :inputOptions=\"{ placeholder: t('auth.resetPassword.phonePlaceholder') }\"\n class=\"bg-light h-4r pd-small radius-small mn-b-thin\"\n />\n </div>\n </transition>\n <!-- Email -->\n <transition name=\"slide-fade\">\n <div v-if=\"tabAuth === 'email'\" class=\"mn-b-semi radius-small o-hidden\">\n <p class=\"mn-b-small t-transp\">{{ t('auth.resetPassword.emailInfo') }}</p>\n <Field\n v-model:field=\"identifier\"\n :placeholder=\"t('auth.resetPassword.emailPlaceholder')\"\n :validation=\"emailValidation\"\n class=\"bg-light h-4r pd-medium radius-small\"\n />\n </div>\n </transition>\n </div>\n\n <!-- Password fields -->\n <div class=\"mn-b-semi\">\n <Field\n v-model:field=\"password\"\n type=\"password\"\n :placeholder=\"t('auth.enterPassword.passwordPlaceholder')\"\n :validation=\"passwordValidation\"\n class=\"bg-light pd-small radius-small mn-b-thin\"\n />\n <Field\n v-model:field=\"passwordRepeat\"\n type=\"password\"\n :placeholder=\"t('auth.enterPassword.repeatPasswordPlaceholder')\"\n class=\"bg-light pd-small radius-small\"\n />\n </div>\n\n <Button :submit=\"onSubmit\" class=\"w-100 bg-main\">\n {{ t('auth.enterPassword.changePasswordBtn') }}\n </Button>\n </section>\n</template>\n\n<script setup>\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport Field from '@martyrs/src/components/Field/Field.vue'\nimport FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'\nimport Button from '@martyrs/src/components/Button/Button.vue'\n\nimport { computed, ref } from 'vue'\nimport { useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport { setError } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport { withOtp } from '@martyrs/src/modules/auth/views/plugins/otp.plugin.js'\nimport $axios from '@martyrs/src/modules/core/views/utils/axios-instance.js'\nimport * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'\n\nconst store = useStore()\nconst core = store.core || { state: {} }\nconst auth = store.auth\n\nconst router = useRouter()\nconst { t } = useI18n({ useScope: 'global' })\n\nconst identifier = ref('')\nconst password = ref('')\nconst passwordRepeat = ref('')\n\nconst phoneValidation = ref(null)\nconst emailValidation = ref(null)\nconst passwordValidation = ref(null)\n\nconst availableTabs = computed(() => {\n const tabs = [\n { name: t('auth.resetPassword.phone'), value: 'phone' },\n { name: t('auth.resetPassword.email'), value: 'email' }\n ]\n const excludeMethods = core.state?.options?.auth?.authMethodsExclude || []\n return tabs.filter(tab => !excludeMethods.includes(tab.value))\n})\n\nconst tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '')\n\nasync function onSubmit() {\n // Validate identifier\n if (tabAuth.value === 'phone') {\n await inputsValidation.validateInputs(\n phoneValidation,\n inputsValidation.validatePhone,\n identifier.value,\n 'Некорректный телефон'\n )\n }\n if (tabAuth.value === 'email') {\n await inputsValidation.validateInputs(\n emailValidation,\n inputsValidation.validateEmail,\n identifier.value,\n 'Некорректный email'\n )\n }\n\n // Validate password\n await inputsValidation.validateInputs(\n passwordValidation,\n inputsValidation.validatePassword,\n password.value,\n 'Некорректный пароль'\n )\n\n if (password.value !== passwordRepeat.value) {\n setError({ response: { data: { errorCode: 'PASSWORDS_DO_NOT_MATCH' } } })\n throw new Error('PASSWORDS_DO_NOT_MATCH')\n }\n\n // Reset password with OTP verification\n try {\n const result = await withOtp(\n (data) => $axios.post('/api/auth/reset-password', data),\n {\n identifier: identifier.value,\n type: tabAuth.value,\n password: password.value\n }\n )\n\n // Success - save token and redirect\n if (result.data?.accessToken) {\n const Cookies = (await import('js-cookie')).default\n Cookies.set('user', JSON.stringify(result.data), { path: '/', expires: 7 })\n await auth.actions.initialize()\n router.push({ name: 'User Profile', params: { _id: result.data._id } })\n } else {\n router.push({ name: 'Sign In' })\n }\n } catch (error) {\n setError(error)\n throw error\n }\n}\n</script>\n\n<style lang=\"scss\">\n.slide-fade-enter-active,\n.slide-fade-leave-active {\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.slide-fade-enter-from,\n.slide-fade-leave-to {\n position: absolute;\n transform: translateX(20px);\n opacity: 0;\n left: 0;\n top: 0;\n}\n</style>\n"],"names":["inputsValidation.validateInputs","inputsValidation.validatePhone","inputsValidation.validateEmail","inputsValidation.validatePassword"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0FA,UAAM,QAAQ,SAAQ;AACtB,UAAM,OAAO,MAAM,QAAQ,EAAE,OAAO,CAAA,EAAE;AACtC,UAAM,OAAO,MAAM;AAEnB,UAAM,SAAS,UAAS;AACxB,UAAM,EAAE,EAAC,IAAK,QAAQ,EAAE,UAAU,SAAQ,CAAE;AAE5C,UAAM,aAAa,IAAI,EAAE;AACzB,UAAM,WAAW,IAAI,EAAE;AACvB,UAAM,iBAAiB,IAAI,EAAE;AAE7B,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,qBAAqB,IAAI,IAAI;AAEnC,UAAM,gBAAgB,SAAS,MAAM;AACnC,YAAM,OAAO;AAAA,QACX,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,QAAO;AAAA,QACrD,EAAE,MAAM,EAAE,0BAA0B,GAAG,OAAO,QAAO;AAAA,MACzD;AACE,YAAM,iBAAiB,KAAK,OAAO,SAAS,MAAM,sBAAsB,CAAA;AACxE,aAAO,KAAK,OAAO,SAAO,CAAC,eAAe,SAAS,IAAI,KAAK,CAAC;AAAA,IAC/D,CAAC;AAED,UAAM,UAAU,IAAI,cAAc,MAAM,SAAS,cAAc,MAAM,CAAC,EAAE,QAAQ,EAAE;AAElF,mBAAe,WAAW;AAExB,UAAI,QAAQ,UAAU,SAAS;AAC7B,cAAMA;AAAAA,UACJ;AAAA,UACAC;AAAAA,UACA,WAAW;AAAA,UACX;AAAA,QACN;AAAA,MACE;AACA,UAAI,QAAQ,UAAU,SAAS;AAC7B,cAAMD;AAAAA,UACJ;AAAA,UACAE;AAAAA,UACA,WAAW;AAAA,UACX;AAAA,QACN;AAAA,MACE;AAGA,YAAMF;AAAAA,QACJ;AAAA,QACAG;AAAAA,QACA,SAAS;AAAA,QACT;AAAA,MACJ;AAEE,UAAI,SAAS,UAAU,eAAe,OAAO;AAC3C,iBAAS,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,yBAAwB,IAAI,CAAE;AACxE,cAAM,IAAI,MAAM,wBAAwB;AAAA,MAC1C;AAGA,UAAI;AACF,cAAM,SAAS,MAAM;AAAA,UACnB,CAAC,SAAS,OAAO,KAAK,4BAA4B,IAAI;AAAA,UACtD;AAAA,YACE,YAAY,WAAW;AAAA,YACvB,MAAM,QAAQ;AAAA,YACd,UAAU,SAAS;AAAA,UAC3B;AAAA,QACA;AAGI,YAAI,OAAO,MAAM,aAAa;AAC5B,gBAAM,WAAW,MAAM,OAAO,kGAAW,GAAG;AAC5C,kBAAQ,IAAI,QAAQ,KAAK,UAAU,OAAO,IAAI,GAAG,EAAE,MAAM,KAAK,SAAS,EAAC,CAAE;AAC1E,gBAAM,KAAK,QAAQ,WAAU;AAC7B,iBAAO,KAAK,EAAE,MAAM,gBAAgB,QAAQ,EAAE,KAAK,OAAO,KAAK,MAAK,CAAE;AAAA,QACxE,OAAO;AACL,iBAAO,KAAK,EAAE,MAAM,UAAS,CAAE;AAAA,QACjC;AAAA,MACF,SAAS,OAAO;AACd,iBAAS,KAAK;AACd,cAAM;AAAA,MACR;AAAA,IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref, computed, onMounted, resolveComponent, createElementBlock, openBlock, createElementVNode, createCommentVNode, createVNode, createTextVNode, toDisplayString, unref, withCtx, Transition, withDirectives, vShow } from "vue";
|
|
2
|
-
import _sfc_main$1 from "../../../../../components/Tab/Tab.
|
|
2
|
+
import _sfc_main$1 from "../../../../../components/Tab/Tab.vue2.js";
|
|
3
3
|
import Field from "../../../../../components/Field/Field.vue.js";
|
|
4
4
|
import _sfc_main$2 from "../../../../../components/FieldPhone/FieldPhone.vue.js";
|
|
5
|
-
import _sfc_main$3 from "../../../../../components/Button/Button.
|
|
5
|
+
import _sfc_main$3 from "../../../../../components/Button/Button.vue.js";
|
|
6
6
|
import { useRoute, useRouter } from "vue-router";
|
|
7
7
|
import { useI18n } from "vue-i18n";
|
|
8
8
|
import { useStore } from "../../../../core/views/store/core.store.js";
|
|
@@ -76,6 +76,7 @@ const _sfc_main = {
|
|
|
76
76
|
}
|
|
77
77
|
const userCopy = { ...state.user };
|
|
78
78
|
await actions.login(userCopy, tabAuth.value);
|
|
79
|
+
redirectTo();
|
|
79
80
|
}
|
|
80
81
|
function redirectTo() {
|
|
81
82
|
if (!state.user._id) {
|
|
@@ -195,7 +196,6 @@ const _sfc_main = {
|
|
|
195
196
|
]),
|
|
196
197
|
createVNode(_sfc_main$3, {
|
|
197
198
|
submit: onSubmit,
|
|
198
|
-
callback: redirectTo,
|
|
199
199
|
class: "w-100 bg-main"
|
|
200
200
|
}, {
|
|
201
201
|
default: withCtx(() => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignIn.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/SignIn.vue"],"sourcesContent":["<template>\n\t<section class=\"\">\n\t\t<!-- Header -->\n\t\t<img loading=\"lazy\" :src=\"'/logo/logo.svg'\" class=\"i-extra radius-small mn-b-small\">\n\n\t\t<h3 class=\"mn-b-medium\">\n\t\t\t{{ t('auth.signIn.title') }}\n\t\t\t<br>\n\t\t\t<span class=\"fw-semi\">{{ t('auth.signIn.subtitle') }}</span>\n\t\t</h3>\n\n\t\t<p class=\"mn-b-big\">\n\t\t\t<router-link :to=\"{name: 'Sign Up', query: { returnUrl: route.query?.returnUrl}}\" class=\"underline t-grey\">{{ t('auth.signIn.signup') }}</router-link>\n\t\t</p>\n\t\t\n\t\t<!-- Select -->\n\t\t<div \n\t\t\tv-if=\"availableTabs.length > 1\" \n\t\t\tclass=\"mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden\"\n\t\t>\n\t\t\t<Tab \n\t\t\t\tv-model:selected=\"tabAuth\"\n\t\t\t\t:tabs=\"availableTabs\"\n\t\t\t\tclassTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n\t\t\t/>\n\t\t</div>\n\t\t<!-- Form -->\n\t\t<div class=\"pos-relative\">\n\t\t<!-- Phone -->\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'phone'\" class=\"mn-b-thin radius-small\">\n\t\t\t\t\t<FieldPhone\n\t\t\t\t\t\t@change=\"(event) => auth.state.user.phone = event\" \t\n\t\t\t\t\t\t:dropdownOptions=\"{\n\t\t\t\t\t\t\tshowDialCodeInSelection: true,\n\t\t\t\t\t\t\tshowFlags: true,\n\t\t\t\t\t\t\tshowDialCodeInList: true,\n\t\t\t\t\t\t\ttabIndex: -1\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:validCharactersOnly=\"true\"\n\t\t\t\t\t\t:validation=\"phoneValidation\" \n\t\t\t\t\t\tmode=\"national\"\n\t\t\t\t\t\t:inputOptions=\"{placeholder: t('auth.signIn.phonePlaceholder'), type: 'tel'}\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-small radius-small mn-b-thin\" \n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'email'\" class=\"mn-b-thin radius-small o-hidden\">\n\t\t\t\t\t<Field \n\t\t\t\t\t\tv-model:field=\"auth.state.user.email\" \t\n\t\t\t\t\t\t:placeholder=\"t('auth.signIn.emailPlaceholder')\" \t\n\t\t\t\t\t\t:validation=\"emailValidation\"\n\t\t\t\t\t\t:tabIndex=\"-1\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-medium radius-small\" \n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\n\t\t<!-- Password -->\n\t\t<Field \n\t\t\tv-model:field=\"auth.state.user.password\"\n\t\t\ttype=\"password\" \t\n\t\t\t:validation=\"passswordValidation\" \n\t\t\t:placeholder=\"t('auth.signIn.passwordPlaceholder')\" \n\t\t\tclass=\"\n bg-light\n pd-medium\n radius-small\n mn-b-semi\n h-4r \n \"\n\t\t/>\n\t\t<!-- Links -->\n\t\t<div class=\"w-100 mn-b-big\">\n\t\t\t<router-link\n\t\t\t\t:to=\"{name: 'Reset Password', query: { returnUrl: route.query?.returnUrl}}\"\n\t\t\t\tclass=\"underline d-block t-blue\"\n\t\t\t>\n\t\t\t\t{{ t('auth.signIn.forgotPassword') }}\n\t\t\t</router-link>\n\t\t</div>\n\t\t<!-- Button -->\n\t\t<Button \n\t\t\t:submit=\"onSubmit\" \n\t\t\
|
|
1
|
+
{"version":3,"file":"SignIn.vue.js","sources":["../../../../../../../../src/modules/auth/views/components/pages/SignIn.vue"],"sourcesContent":["<template>\n\t<section class=\"\">\n\t\t<!-- Header -->\n\t\t<img loading=\"lazy\" :src=\"'/logo/logo.svg'\" class=\"i-extra radius-small mn-b-small\">\n\n\t\t<h3 class=\"mn-b-medium\">\n\t\t\t{{ t('auth.signIn.title') }}\n\t\t\t<br>\n\t\t\t<span class=\"fw-semi\">{{ t('auth.signIn.subtitle') }}</span>\n\t\t</h3>\n\n\t\t<p class=\"mn-b-big\">\n\t\t\t<router-link :to=\"{name: 'Sign Up', query: { returnUrl: route.query?.returnUrl}}\" class=\"underline t-grey\">{{ t('auth.signIn.signup') }}</router-link>\n\t\t</p>\n\t\t\n\t\t<!-- Select -->\n\t\t<div \n\t\t\tv-if=\"availableTabs.length > 1\" \n\t\t\tclass=\"mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden\"\n\t\t>\n\t\t\t<Tab \n\t\t\t\tv-model:selected=\"tabAuth\"\n\t\t\t\t:tabs=\"availableTabs\"\n\t\t\t\tclassTab=\"pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small\"\n\t\t\t/>\n\t\t</div>\n\t\t<!-- Form -->\n\t\t<div class=\"pos-relative\">\n\t\t<!-- Phone -->\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'phone'\" class=\"mn-b-thin radius-small\">\n\t\t\t\t\t<FieldPhone\n\t\t\t\t\t\t@change=\"(event) => auth.state.user.phone = event\" \t\n\t\t\t\t\t\t:dropdownOptions=\"{\n\t\t\t\t\t\t\tshowDialCodeInSelection: true,\n\t\t\t\t\t\t\tshowFlags: true,\n\t\t\t\t\t\t\tshowDialCodeInList: true,\n\t\t\t\t\t\t\ttabIndex: -1\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:validCharactersOnly=\"true\"\n\t\t\t\t\t\t:validation=\"phoneValidation\" \n\t\t\t\t\t\tmode=\"national\"\n\t\t\t\t\t\t:inputOptions=\"{placeholder: t('auth.signIn.phonePlaceholder'), type: 'tel'}\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-small radius-small mn-b-thin\" \n\t\t\t\t\t/>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t\t<transition name=\"slide-fade\">\n\t\t\t\t<div v-show=\"tabAuth === 'email'\" class=\"mn-b-thin radius-small o-hidden\">\n\t\t\t\t\t<Field \n\t\t\t\t\t\tv-model:field=\"auth.state.user.email\" \t\n\t\t\t\t\t\t:placeholder=\"t('auth.signIn.emailPlaceholder')\" \t\n\t\t\t\t\t\t:validation=\"emailValidation\"\n\t\t\t\t\t\t:tabIndex=\"-1\"\n\t\t\t\t\t\tclass=\"bg-light h-4r pd-medium radius-small\" \n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</transition>\n\t\t</div>\n\n\t\t<!-- Password -->\n\t\t<Field \n\t\t\tv-model:field=\"auth.state.user.password\"\n\t\t\ttype=\"password\" \t\n\t\t\t:validation=\"passswordValidation\" \n\t\t\t:placeholder=\"t('auth.signIn.passwordPlaceholder')\" \n\t\t\tclass=\"\n bg-light\n pd-medium\n radius-small\n mn-b-semi\n h-4r \n \"\n\t\t/>\n\t\t<!-- Links -->\n\t\t<div class=\"w-100 mn-b-big\">\n\t\t\t<router-link\n\t\t\t\t:to=\"{name: 'Reset Password', query: { returnUrl: route.query?.returnUrl}}\"\n\t\t\t\tclass=\"underline d-block t-blue\"\n\t\t\t>\n\t\t\t\t{{ t('auth.signIn.forgotPassword') }}\n\t\t\t</router-link>\n\t\t</div>\n\t\t<!-- Button -->\n\t\t<Button \n\t\t\t:submit=\"onSubmit\" \n\t\t\tclass=\"w-100 bg-main\"\n\t\t>\n\t\t\t{{ t('auth.signIn.signin') }}\n\t\t</Button>\n\t\t\n\t\t<!-- <Button \n\t\t\t:submit=\"onSubmitApple\" \n\t\t\t:callback=\"redirectTo\" \n\t\t\tclass=\"mn-b-thin bg-black t-white\"\n\t\t>\n\t\t\t{{ t('auth.signIn.signin_apple') }}\n\t\t</Button> -->\n\t</section> \n</template>\n\n<script setup>\n// Import components\nimport Tab from '@martyrs/src/components/Tab/Tab.vue'\nimport Field from '@martyrs/src/components/Field/Field.vue'\nimport FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'\nimport Button from '@martyrs/src/components/Button/Button.vue'\n// Import libs\nimport { computed, onMounted, ref, inject } from 'vue'\nimport { useRoute, useRouter } from 'vue-router'\nimport { useI18n } from 'vue-i18n'\n// Import store\nimport { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'\nimport * as auth from '@martyrs/src/modules/auth/views/store/auth.js'\n// Import validation\nimport * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'\n\n// Get store\nconst store = useStore()\nconst core = store.core\n\n// Init validation\nconst phoneValidation = ref(null)\nconst passswordValidation = ref(null)\nconst emailValidation = ref(null)\n// Accessing router\nconst route = useRoute()\nconst router = useRouter()\n// Localization\nconst { t } = useI18n({\n\tuseScope: 'global'\n})\n// Accessing state\nconst availableTabs = computed(() => {\n const tabs = [\n { name: t('auth.signIn.phone'), value: 'phone' },\n { name: t('auth.signIn.email'), value: 'email' }\n ];\n const excludeMethods = core.state?.options?.auth?.authMethodsExclude || [];\n return tabs.filter(tab => !excludeMethods.includes(tab.value));\n});\n\nconst tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '');\n\nconst loadExternalScript = (src) => {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = src;\n script.onload = resolve;\n script.onerror = reject;\n document.head.appendChild(script);\n });\n}\n\nonMounted(async () => {\n\tawait loadExternalScript('https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js');\n});\n// Methods\nasync function onSubmit() {\n\ttry {\n\t if (tabAuth.value === 'phone') await inputsValidation.validateInputs(\n\t\t\tphoneValidation, \n\t\t\tinputsValidation.validatePhone, \n\t\t\tauth.state.user.phone, \n\t\t\t'Некорректный телефон'\n\t\t)\n\t\tif (tabAuth.value === 'email') await inputsValidation.validateInputs(\n\t\t\temailValidation, \n\t\t\tinputsValidation.validateEmail, \n\t\t\tauth.state.user.email, \n\t\t\t'Некорректный email'\n\t\t)\n\t} catch (error) {\n\t\tconsole.log(error)\n\t\tthrow new Error\n\t}\n\n\t// COSTIL PLEASE GOD MAKE IT GOOD, FUKEN INPUT COMPONENT RETURN OBJECT NUT NUMBER\n\tconst userCopy = {...auth.state.user};\n\t// COSTIL PLEASE GOD MAKE IT GOOD, FUKEN INPUT COMPONENT RETURN OBJECT NUT NUMBER\n\n \tawait auth.actions.login(userCopy, tabAuth.value)\n\n\tredirectTo()\n}\n\nasync function onSubmitApple() {\n try {\n window.AppleID.auth.init({\n clientId: 'com.thecommune.app.signin',\n scope: 'email name',\n redirectURI: 'https://thecommunephuket.com/auth/signin',\n usePopup: true,\n });\n\n let response = await window.AppleID.auth.signIn();\n\n if (response) {\n console.log(response);\n await auth.actions.login(response, 'apple');\n }\n\n } catch (error) {\n console.error(error);\n throw new Error('Error during Apple authentication');\n }\n}\n\nfunction redirectTo () {\n\tif (!auth.state.user._id) {\n\t\tthrow new Error('AUTH_STATE_NOT_INITIALIZED')\n\t}\n\n\tif (route.query?.returnUrl) {\n\t\trouter.push({\n\t\t\tpath: route.query?.returnUrl,\n\t\t\tquery: {\n\t\t\t\tafterAuth: 'true'\n\t\t\t}\n\t\t})\n\t} else {\n\t\trouter.push({\n\t\t\tname: 'User Profile',\n\t\t\tparams: {\n\t\t\t\t_id: auth.state.user._id\n\t\t\t},\n\t\t\tquery: {\n\t\t\t\tafterAuth: 'true'\n\t\t\t}\n\t\t})\n\t}\n}\n</script>\n\n<style lang=\"scss\">\n\n\t.input-error {\n\t border: 1px solid red;\n\t box-shadow: 0 0 3px 0 red;\n\t}\n</style>"],"names":["inputsValidation.validateInputs","inputsValidation.validatePhone","auth.state","inputsValidation.validateEmail","auth.actions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuHA,UAAM,QAAQ,SAAQ;AACtB,UAAM,OAAO,MAAM;AAGnB,UAAM,kBAAkB,IAAI,IAAI;AAChC,UAAM,sBAAsB,IAAI,IAAI;AACpC,UAAM,kBAAkB,IAAI,IAAI;AAEhC,UAAM,QAAQ,SAAQ;AACtB,UAAM,SAAS,UAAS;AAExB,UAAM,EAAE,EAAC,IAAK,QAAQ;AAAA,MACrB,UAAU;AAAA,IACX,CAAC;AAED,UAAM,gBAAgB,SAAS,MAAM;AACjC,YAAM,OAAO;AAAA,QACT,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,QAC9C,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,QAAO;AAAA,MACtD;AACI,YAAM,iBAAiB,KAAK,OAAO,SAAS,MAAM,sBAAsB,CAAA;AACxE,aAAO,KAAK,OAAO,SAAO,CAAC,eAAe,SAAS,IAAI,KAAK,CAAC;AAAA,IACjE,CAAC;AAED,UAAM,UAAU,IAAI,cAAc,MAAM,SAAS,cAAc,MAAM,CAAC,EAAE,QAAQ,EAAE;AAElF,UAAM,qBAAqB,CAAC,QAAQ;AAClC,aAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,cAAM,SAAS,SAAS,cAAc,QAAQ;AAC9C,eAAO,OAAO;AACd,eAAO,MAAM;AACb,eAAO,SAAS;AAChB,eAAO,UAAU;AACjB,iBAAS,KAAK,YAAY,MAAM;AAAA,MAClC,CAAC;AAAA,IACH;AAEA,cAAU,YAAY;AACrB,YAAM,mBAAmB,sFAAsF;AAAA,IAChH,CAAC;AAED,mBAAe,WAAW;AACzB,UAAI;AACF,YAAI,QAAQ,UAAU,QAAS,OAAMA;AAAAA,UACrC;AAAA,UACAC;AAAAA,UACAC,MAAW,KAAK;AAAA,UAChB;AAAA,QACH;AACE,YAAI,QAAQ,UAAU,QAAS,OAAMF;AAAAA,UACpC;AAAA,UACAG;AAAAA,UACAD,MAAW,KAAK;AAAA,UAChB;AAAA,QACH;AAAA,MACC,SAAS,OAAO;AACf,gBAAQ,IAAI,KAAK;AACjB,cAAM,IAAI;AAAA,MACX;AAGA,YAAM,WAAW,EAAC,GAAGA,MAAW,KAAI;AAGnC,YAAME,QAAa,MAAM,UAAU,QAAQ,KAAK;AAEjD,iBAAU;AAAA,IACX;AAwBA,aAAS,aAAc;AACtB,UAAI,CAACF,MAAW,KAAK,KAAK;AACzB,cAAM,IAAI,MAAM,4BAA4B;AAAA,MAC7C;AAEA,UAAI,MAAM,OAAO,WAAW;AAC3B,eAAO,KAAK;AAAA,UACX,MAAM,MAAM,OAAO;AAAA,UACnB,OAAO;AAAA,YACN,WAAW;AAAA,UACf;AAAA,QACA,CAAG;AAAA,MACF,OAAO;AACN,eAAO,KAAK;AAAA,UACX,MAAM;AAAA,UACN,QAAQ;AAAA,YACP,KAAKA,MAAW,KAAK;AAAA,UACzB;AAAA,UACG,OAAO;AAAA,YACN,WAAW;AAAA,UACf;AAAA,QACA,CAAG;AAAA,MACF;AAAA,IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|