@ozdao/martyrs 0.2.585 → 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.
Files changed (386) hide show
  1. package/dist/auth.server.js +161 -96
  2. package/dist/{authJwt-J1csaMWA.js → authJwt-DKbMMjw0.js} +33 -0
  3. package/dist/chats.server.js +2 -2
  4. package/dist/community.server.js +1 -1
  5. package/dist/core.server.js +191 -2
  6. package/dist/{core.websocket-C2FxNmZ1.js → core.websocket-Cl76z2wT.js} +41 -5
  7. package/dist/{crud-q1ye5IhV.js → crud-DpOXTZep.js} +1 -1
  8. package/dist/events.server.js +2 -2
  9. package/dist/files.server.js +1 -1
  10. package/dist/gallery.server.js +1 -1
  11. package/dist/index-kvBwwb0w.js +427 -0
  12. package/dist/inventory.server.js +2 -2
  13. package/dist/{mailing-DuEFRsa3.js → mailing-DT7nbNjZ.js} +16 -3
  14. package/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +863 -865
  15. package/dist/marketplace.server.js +1 -1
  16. package/dist/martyrs/dist/{main-xL-jtBkT.js → main-BIf-WirR.js} +192 -38
  17. package/dist/martyrs/dist/main-BIf-WirR.js.map +1 -0
  18. package/dist/martyrs/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +2 -2
  19. package/dist/martyrs/dist/{web-BA6h6Z8P.js.map → web-O7lXcjg0.js.map} +1 -1
  20. package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +8 -7
  21. package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
  22. package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
  23. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
  24. package/dist/martyrs/src/components/Loader/Loader.vue.js +1 -1
  25. package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -1
  26. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.js → Spoiler.vue.js} +2 -2
  27. package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +1 -0
  28. package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js +17 -22
  29. package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js.map +1 -1
  30. package/dist/martyrs/src/modules/auth/auth.client.js +18 -24
  31. package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
  32. package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js +178 -0
  33. package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js.map +1 -0
  34. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
  35. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +53 -45
  36. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
  37. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +198 -14
  38. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js.map +1 -1
  39. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
  40. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +70 -29
  41. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js.map +1 -1
  42. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +2 -2
  43. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
  44. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +86 -30
  45. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js.map +1 -1
  46. package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js +100 -0
  47. package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js.map +1 -0
  48. package/dist/martyrs/src/modules/auth/views/router/auth.router.js +2 -31
  49. package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -1
  50. package/dist/martyrs/src/modules/auth/views/router/users.router.js +0 -14
  51. package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -1
  52. package/dist/martyrs/src/modules/auth/views/store/auth.js +1 -56
  53. package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
  54. package/dist/martyrs/src/modules/auth/views/store/users.js +5 -1
  55. package/dist/martyrs/src/modules/auth/views/store/users.js.map +1 -1
  56. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +1 -1
  57. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  58. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +0 -1
  59. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js.map +1 -1
  60. package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
  61. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
  62. package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js +74 -0
  63. package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js.map +1 -0
  64. package/dist/martyrs/src/modules/core/views/components/layouts/App.vue.js.map +1 -1
  65. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +63 -47
  66. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
  67. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +1 -1
  68. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
  69. package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
  70. package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
  71. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +1 -0
  72. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  73. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  74. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
  75. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  76. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
  77. package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
  78. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  79. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
  80. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
  81. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
  82. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
  83. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
  84. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
  85. package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
  86. package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +1 -1
  87. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
  88. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
  89. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
  90. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
  91. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
  92. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
  93. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
  94. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
  95. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +1 -1
  96. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
  97. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
  98. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
  99. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
  100. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
  101. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
  102. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +0 -1
  103. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js.map +1 -1
  104. package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +1 -1
  105. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
  106. package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
  107. package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
  108. package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +1 -1
  109. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
  110. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
  111. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -2
  112. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js.map +1 -1
  113. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  114. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
  115. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  116. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
  117. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
  118. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  119. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  120. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  121. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
  122. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
  123. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
  124. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
  125. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  126. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -2
  127. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js.map +1 -1
  128. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  129. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +0 -1
  130. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js.map +1 -1
  131. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +0 -1
  132. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js.map +1 -1
  133. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  134. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  135. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +0 -1
  136. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
  137. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  138. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +0 -1
  139. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
  140. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  141. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +3 -3
  142. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
  143. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
  144. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
  145. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +1 -1
  146. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  147. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
  148. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
  149. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  150. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +1 -1
  151. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
  152. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  153. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  154. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
  155. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
  156. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
  157. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
  158. package/dist/martyrs.css +1 -1
  159. package/dist/martyrs.es.js +1 -1
  160. package/dist/music.server.js +1 -1
  161. package/dist/notifications.server.js +1 -1
  162. package/dist/orders.server.js +7 -6
  163. package/dist/organizations.server.js +2 -2
  164. package/dist/products.server.js +2 -2
  165. package/dist/profile.schema-C31Lynn3.js +21 -0
  166. package/dist/rents.server.js +1 -1
  167. package/dist/sessions.service-COcwjd0f.js +86 -0
  168. package/dist/style.css +178 -108
  169. package/dist/{tickets.controller-B7r0mK-5.js → tickets.controller-DdF85W-i.js} +1 -1
  170. package/dist/visitors.service-B1dhhuSo.js +83 -0
  171. package/dist/wallet.server.js +2 -2
  172. package/dist/{web-BA6h6Z8P.js → web-O7lXcjg0.js} +1 -1
  173. package/package.json +5 -1
  174. package/src/cli/commands/create.js +106 -0
  175. package/src/cli/index.js +25 -0
  176. package/src/cli/templates/app/.env.development.mustache +14 -0
  177. package/src/cli/templates/app/.env.production.mustache +14 -0
  178. package/src/cli/templates/app/Dockerfile +36 -0
  179. package/src/cli/templates/app/babel.config.js +14 -0
  180. package/src/cli/templates/app/env.js +3 -0
  181. package/src/cli/templates/app/index.js +46 -0
  182. package/src/cli/templates/app/mongodb.config.js +18 -0
  183. package/src/cli/templates/app/package.json.mustache +65 -0
  184. package/src/cli/templates/app/src/client.js +22 -0
  185. package/src/cli/templates/app/src/components/pages/Index.vue +11 -0
  186. package/src/cli/templates/app/src/configs/global.config.js.mustache +40 -0
  187. package/src/cli/templates/app/src/localization/extensions.js +2 -0
  188. package/src/cli/templates/app/src/localization/index.js +44 -0
  189. package/src/cli/templates/app/src/localization/overrides.js +2 -0
  190. package/src/cli/templates/app/src/localization/translations.js +10 -0
  191. package/src/cli/templates/app/src/models/index.js +9 -0
  192. package/src/cli/templates/app/src/router/index.js +48 -0
  193. package/src/cli/templates/app/src/scss/theme.scss +18 -0
  194. package/src/cli/templates/app/src/server.js +68 -0
  195. package/src/cli/templates/app/src/store/index.js +9 -0
  196. package/src/cli/templates/docker-compose.yaml.mustache +47 -0
  197. package/src/cli/templates/nginx/Dockerfile +5 -0
  198. package/src/cli/templates/nginx/default.conf.mustache +55 -0
  199. package/src/cli/templates/public/favicon/.gitkeep +0 -0
  200. package/src/cli/templates/start-dev.sh.mustache +131 -0
  201. package/src/cli/templates/start-prod.sh.mustache +12 -0
  202. package/src/components/Button/Button.vue +61 -15
  203. package/src/components/Loader/Loader.vue +1 -1
  204. package/src/components/Tooltip/Tooltip.vue +31 -23
  205. package/src/modules/TASKS.MD +30 -1
  206. package/src/modules/auth/CLAUDE.md +381 -0
  207. package/src/modules/auth/FIXES.md +0 -38
  208. package/src/modules/auth/auth.client.js +4 -6
  209. package/src/modules/auth/auth.server.js +4 -15
  210. package/src/modules/auth/controllers/middlewares/authJwt.js +59 -17
  211. package/src/modules/auth/controllers/middlewares/index.js +4 -1
  212. package/src/modules/auth/controllers/middlewares/otp.middleware.js +166 -0
  213. package/src/modules/auth/controllers/middlewares/verifySignUp.js +0 -1
  214. package/src/modules/auth/controllers/middlewares/verifyUser.js +58 -11
  215. package/src/modules/auth/controllers/routes/auth.routes.js +48 -6
  216. package/src/modules/auth/controllers/routes/users.routes.js +29 -8
  217. package/src/modules/auth/controllers/services/auth.service.js +62 -12
  218. package/src/modules/auth/controllers/services/otp.service.js +109 -0
  219. package/src/modules/auth/controllers/services/users.service.js +46 -6
  220. package/src/modules/auth/models/otp.model.js +20 -0
  221. package/src/modules/auth/views/components/blocks/OtpDialog.vue +168 -0
  222. package/src/modules/auth/views/components/pages/Profile.vue +18 -13
  223. package/src/modules/auth/views/components/pages/ProfileEditAccount.vue +199 -45
  224. package/src/modules/auth/views/components/pages/ResetPassword.vue +170 -132
  225. package/src/modules/auth/views/components/pages/SignIn.vue +2 -1
  226. package/src/modules/auth/views/components/pages/SignUp.vue +203 -147
  227. package/src/modules/auth/views/plugins/otp.plugin.js +104 -0
  228. package/src/modules/auth/views/router/auth.router.js +1 -24
  229. package/src/modules/auth/views/router/users.router.js +1 -12
  230. package/src/modules/auth/views/store/auth.js +0 -68
  231. package/src/modules/auth/views/store/users.js +6 -2
  232. package/src/modules/core/controllers/classes/core.websocket.js +57 -6
  233. package/src/modules/core/controllers/middlewares/visitor.logger.js +49 -0
  234. package/src/modules/core/controllers/services/requests.service.js +53 -0
  235. package/src/modules/core/controllers/services/sessions.service.js +98 -0
  236. package/src/modules/core/controllers/services/visitors.service.js +102 -0
  237. package/src/modules/core/controllers/utils/mailing.js +16 -3
  238. package/src/modules/core/core.server.js +45 -3
  239. package/src/modules/core/models/request.model.js +30 -0
  240. package/src/modules/core/models/session.model.js +43 -0
  241. package/src/modules/core/models/visitor.model.js +28 -0
  242. package/src/modules/core/views/components/elements/OnlineIndicator.vue +115 -0
  243. package/src/modules/core/views/components/layouts/App.vue +2 -2
  244. package/src/modules/core/views/components/layouts/Client.vue +443 -477
  245. package/src/modules/orders/controllers/orders.controller.js +3 -3
  246. package/src/modules/products/components/pages/Products.vue +1 -1
  247. package/dist/_virtual/alignment-pattern.js +0 -5
  248. package/dist/_virtual/alignment-pattern.js.map +0 -1
  249. package/dist/_virtual/browser.js +0 -8
  250. package/dist/_virtual/browser.js.map +0 -1
  251. package/dist/_virtual/browser2.js +0 -5
  252. package/dist/_virtual/browser2.js.map +0 -1
  253. package/dist/_virtual/canvas.js +0 -5
  254. package/dist/_virtual/canvas.js.map +0 -1
  255. package/dist/_virtual/dijkstra.js +0 -5
  256. package/dist/_virtual/dijkstra.js.map +0 -1
  257. package/dist/_virtual/error-correction-code.js +0 -5
  258. package/dist/_virtual/error-correction-code.js.map +0 -1
  259. package/dist/_virtual/error-correction-level.js +0 -5
  260. package/dist/_virtual/error-correction-level.js.map +0 -1
  261. package/dist/_virtual/finder-pattern.js +0 -5
  262. package/dist/_virtual/finder-pattern.js.map +0 -1
  263. package/dist/_virtual/format-info.js +0 -5
  264. package/dist/_virtual/format-info.js.map +0 -1
  265. package/dist/_virtual/galois-field.js +0 -5
  266. package/dist/_virtual/galois-field.js.map +0 -1
  267. package/dist/_virtual/mask-pattern.js +0 -5
  268. package/dist/_virtual/mask-pattern.js.map +0 -1
  269. package/dist/_virtual/mode.js +0 -5
  270. package/dist/_virtual/mode.js.map +0 -1
  271. package/dist/_virtual/polynomial.js +0 -5
  272. package/dist/_virtual/polynomial.js.map +0 -1
  273. package/dist/_virtual/qrcode.js +0 -5
  274. package/dist/_virtual/qrcode.js.map +0 -1
  275. package/dist/_virtual/regex.js +0 -5
  276. package/dist/_virtual/regex.js.map +0 -1
  277. package/dist/_virtual/segments.js +0 -5
  278. package/dist/_virtual/segments.js.map +0 -1
  279. package/dist/_virtual/svg-tag.js +0 -5
  280. package/dist/_virtual/svg-tag.js.map +0 -1
  281. package/dist/_virtual/utils.js +0 -5
  282. package/dist/_virtual/utils.js.map +0 -1
  283. package/dist/_virtual/utils2.js +0 -5
  284. package/dist/_virtual/utils2.js.map +0 -1
  285. package/dist/_virtual/version-check.js +0 -5
  286. package/dist/_virtual/version-check.js.map +0 -1
  287. package/dist/_virtual/version.js +0 -5
  288. package/dist/_virtual/version.js.map +0 -1
  289. package/dist/index-_Edcmck_.js +0 -170
  290. package/dist/martyrs/dist/main-xL-jtBkT.js.map +0 -1
  291. package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +0 -1336
  292. package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js.map +0 -1
  293. package/dist/martyrs/src/components/Button/Button.vue2.js.map +0 -1
  294. package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +0 -1
  295. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +0 -166
  296. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js.map +0 -1
  297. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +0 -118
  298. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js.map +0 -1
  299. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +0 -360
  300. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js.map +0 -1
  301. package/dist/martyrs/src/modules/auth/views/store/twofa.js +0 -40
  302. package/dist/martyrs/src/modules/auth/views/store/twofa.js.map +0 -1
  303. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +0 -1
  304. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js +0 -43
  305. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js.map +0 -1
  306. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +0 -47
  307. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js.map +0 -1
  308. package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js +0 -29
  309. package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js.map +0 -1
  310. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +0 -89
  311. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js.map +0 -1
  312. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js +0 -136
  313. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js.map +0 -1
  314. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +0 -238
  315. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js.map +0 -1
  316. package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js +0 -9
  317. package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js.map +0 -1
  318. package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js +0 -134
  319. package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js.map +0 -1
  320. package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js +0 -106
  321. package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js.map +0 -1
  322. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js +0 -79
  323. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js.map +0 -1
  324. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js +0 -14
  325. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js.map +0 -1
  326. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js +0 -43
  327. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js.map +0 -1
  328. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js +0 -85
  329. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js.map +0 -1
  330. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js +0 -40
  331. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js.map +0 -1
  332. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js +0 -34
  333. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js.map +0 -1
  334. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js +0 -36
  335. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js.map +0 -1
  336. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js +0 -367
  337. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js.map +0 -1
  338. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js +0 -52
  339. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js.map +0 -1
  340. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js +0 -25
  341. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js.map +0 -1
  342. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js +0 -24
  343. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js.map +0 -1
  344. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js +0 -38
  345. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js.map +0 -1
  346. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js +0 -46
  347. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js.map +0 -1
  348. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js +0 -149
  349. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js.map +0 -1
  350. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js +0 -90
  351. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js.map +0 -1
  352. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js +0 -41
  353. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js.map +0 -1
  354. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js +0 -44
  355. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js.map +0 -1
  356. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js +0 -279
  357. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js.map +0 -1
  358. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js +0 -38
  359. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +0 -1
  360. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js +0 -33
  361. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js.map +0 -1
  362. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js +0 -201
  363. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js.map +0 -1
  364. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +0 -84
  365. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js.map +0 -1
  366. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js +0 -14
  367. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js.map +0 -1
  368. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js +0 -107
  369. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js.map +0 -1
  370. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js +0 -61
  371. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js.map +0 -1
  372. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js +0 -64
  373. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js.map +0 -1
  374. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +0 -87
  375. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js.map +0 -1
  376. package/dist/profile.schema-CjLOfG7b.js +0 -92
  377. package/src/modules/auth/controllers/middlewares/visitor.logger.js +0 -75
  378. package/src/modules/auth/controllers/routes/twofa.routes.js +0 -8
  379. package/src/modules/auth/controllers/services/twofa.service.js +0 -30
  380. package/src/modules/auth/models/request.model.js +0 -14
  381. package/src/modules/auth/models/visitor.model.js +0 -11
  382. package/src/modules/auth/views/components/pages/EnterCode.vue +0 -204
  383. package/src/modules/auth/views/components/pages/EnterPassword.vue +0 -123
  384. package/src/modules/auth/views/components/sections/ProfileEditCredentials.vue +0 -329
  385. package/src/modules/auth/views/store/twofa.js +0 -70
  386. 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,157 +1,213 @@
1
1
  <template>
2
- <section class="t-left pd-medium">
3
- <!-- Header -->
4
- <!-- <img loading="lazy" src="@/assets/images/logo.svg" class="i-extra mn-b-small"> -->
5
- <h3 class="mn-b-small">{{t('auth.signUp.title')}}</h3>
6
-
7
- <!-- Select -->
8
- <div
9
- v-if="availableTabs.length > 1"
10
- class="mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden"
11
- >
12
- <Tab
13
- v-model:selected="tabAuth"
14
- :tabs="availableTabs"
15
- classTab="pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small"
16
- />
17
- </div>
18
-
19
- <!-- Form -->
20
- <div class="pos-relative">
21
- <!-- Phone -->
22
- <transition name="slide-fade">
23
- <div v-show="tabAuth === 'phone'" class="mn-b-semi radius-small">
24
- <p class="mn-b-small t-transp">{{t('auth.signUp.smsNotice')}}</p>
25
- <FieldPhone
26
- @change="(event) => auth.state.user.phone = event"
27
- :dropdownOptions="{
28
- showDialCodeInSelection: true,
29
- showFlags: true,
30
- showDialCodeInList: true
31
- }"
32
- :validation="phoneValidation"
33
- mode="national"
34
- :inputOptions="{placeholder: t('auth.signUp.phonePlaceholder')}"
35
- class="bg-light h-4r pd-small radius-small mn-b-thin"
36
- />
37
-
38
- </div>
39
- </transition>
40
- <transition name="slide-fade">
41
- <div v-show="tabAuth === 'email'" class="mn-b-semi radius-small o-hidden">
42
- <p class="mn-b-small t-transp">{{t('auth.signUp.emailNotice')}}</p>
43
- <Field
44
- v-model:field="auth.state.user.email"
45
- :placeholder="t('auth.signUp.emailPlaceholder')"
46
- :validation="emailValidation"
47
- class="bg-light h-4r pd-medium radius-small"
48
- />
49
- </div>
50
- </transition>
51
- </div>
52
-
53
- <!-- Button -->
54
- <Button :submit="onSubmit" :callback="redirectTo" class="w-100 bg-main mn-b-big">{{t('auth.signUp.sendCode')}}</Button>
55
-
56
- <!-- Links -->
57
- <div class="w-100">
58
- <router-link :to="{name: 'Sign In', query: { returnUrl: route.query.returnUrl}}" class="underline mn-b-medium d-block t-blue">{{t('auth.signUp.haveAccount')}}</router-link>
59
- </div>
60
-
61
- </section>
2
+ <section class="t-left pd-medium">
3
+ <h3 class="mn-b-small">{{ t('auth.signUp.title') }}</h3>
4
+
5
+ <!-- Tab selector -->
6
+ <div
7
+ v-if="availableTabs.length > 1"
8
+ class="mn-b-small p-small uppercase fw-semi bg-light radius-small o-hidden"
9
+ >
10
+ <Tab
11
+ v-model:selected="tabAuth"
12
+ :tabs="availableTabs"
13
+ classTab="pd-small pd-r-medium pd-l-medium w-100 pd-small radius-small"
14
+ />
15
+ </div>
16
+
17
+ <!-- Form -->
18
+ <div class="pos-relative">
19
+ <!-- Phone -->
20
+ <transition name="slide-fade">
21
+ <div v-show="tabAuth === 'phone'" class="mn-b-semi radius-small">
22
+ <p class="mn-b-small t-transp">{{ t('auth.signUp.smsNotice') }}</p>
23
+ <FieldPhone
24
+ @change="(event) => phone = event"
25
+ :dropdownOptions="{
26
+ showDialCodeInSelection: true,
27
+ showFlags: true,
28
+ showDialCodeInList: true
29
+ }"
30
+ :validation="phoneValidation"
31
+ mode="national"
32
+ :inputOptions="{ placeholder: t('auth.signUp.phonePlaceholder') }"
33
+ class="bg-light h-4r pd-small radius-small mn-b-thin"
34
+ />
35
+ </div>
36
+ </transition>
37
+ <!-- Email -->
38
+ <transition name="slide-fade">
39
+ <div v-show="tabAuth === 'email'" class="mn-b-semi radius-small o-hidden">
40
+ <p class="mn-b-small t-transp">{{ t('auth.signUp.emailNotice') }}</p>
41
+ <Field
42
+ v-model:field="email"
43
+ :placeholder="t('auth.signUp.emailPlaceholder')"
44
+ :validation="emailValidation"
45
+ class="bg-light h-4r pd-medium radius-small"
46
+ />
47
+ </div>
48
+ </transition>
49
+ </div>
50
+
51
+ <!-- Password fields -->
52
+ <div class="mn-b-semi">
53
+ <Field
54
+ v-model:field="password"
55
+ type="password"
56
+ :placeholder="t('auth.enterPassword.passwordPlaceholder')"
57
+ :validation="passwordValidation"
58
+ class="bg-light pd-small radius-small mn-b-thin"
59
+ />
60
+ <Field
61
+ v-model:field="passwordRepeat"
62
+ type="password"
63
+ :placeholder="t('auth.enterPassword.repeatPasswordPlaceholder')"
64
+ class="bg-light pd-small radius-small"
65
+ />
66
+ </div>
67
+
68
+ <!-- EULA -->
69
+ <div class="p-regular fw-semi mn-b-semi">
70
+ By registering, you agree to our
71
+ <a class="t-grey" href="/legal/eula" target="_blank" rel="noopener noreferrer">End User License Agreement (EULA)</a>
72
+ </div>
73
+
74
+ <!-- Button -->
75
+ <Button :submit="onSubmit" class="w-100 bg-main mn-b-big">
76
+ {{ t('auth.enterPassword.registerBtn') }}
77
+ </Button>
78
+
79
+ <!-- Links -->
80
+ <div class="w-100">
81
+ <router-link
82
+ :to="{ name: 'Sign In', query: { returnUrl: route.query.returnUrl } }"
83
+ class="underline mn-b-medium d-block t-blue"
84
+ >
85
+ {{ t('auth.signUp.haveAccount') }}
86
+ </router-link>
87
+ </div>
88
+ </section>
62
89
  </template>
63
90
 
64
- <script setup>
65
- // Import components
66
- import Tab from '@martyrs/src/components/Tab/Tab.vue'
67
- import Field from '@martyrs/src/components/Field/Field.vue'
68
- import FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'
69
- import Button from '@martyrs/src/components/Button/Button.vue'
70
- // Import libs
71
- import { computed, onMounted, ref } from 'vue'
72
- import { useRoute, useRouter } from 'vue-router'
73
- import { useI18n } from 'vue-i18n'
74
- // Import store
75
- import { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'
76
- // Import validation
77
- import * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'
78
-
79
- // Get store
80
- const store = useStore()
81
- const auth = store.auth || { state: {}, actions: {} }
82
- const twofa = store.twofa || { state: {}, actions: {}, sendCode: () => {} }
83
- const core = store.core || { state: {}, actions: {} }
84
- // Localization
85
- const { t } = useI18n({
86
- useScope: 'global',
87
- })
88
- // Validation
89
- const phoneValidation = ref(null)
90
- const emailValidation = ref(null)
91
- // Accessing router
92
- const route = useRoute()
93
- const router = useRouter()
94
- // Accessing state
95
- const availableTabs = computed(() => {
96
- const tabs = [
97
- { name: t('auth.signUp.phone'), value: 'phone' },
98
- { name: t('auth.signUp.email'), value: 'email' }
99
- ];
100
- const excludeMethods = core.state?.options?.auth?.authMethodsExclude || [];
101
- return tabs.filter(tab => !excludeMethods.includes(tab.value));
102
- });
103
-
104
- const tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '');
105
- // Methods
106
- async function onSubmit() {
107
- try {
108
- if (tabAuth.value === 'phone') await inputsValidation.validateInputs(
109
- phoneValidation,
110
- inputsValidation.validatePhone,
111
- auth.state.user.phone,
112
- 'Некорректный телефон'
113
- )
114
- if (tabAuth.value === 'email') await inputsValidation.validateInputs(
115
- emailValidation,
116
- inputsValidation.validateEmail,
117
- auth.state.user.email,
118
- 'Некорректный email'
119
- )
120
- } catch (error) {
121
- throw new Error
122
- }
123
- try {
124
- await twofa.sendCode(auth.state.user, 'signup', tabAuth.value)
125
- } catch (error) {
126
- throw new Error
127
- }
128
- }
129
-
130
- function redirectTo () {
131
- router.push({ name: 'Enter Code', query: { returnUrl: route.query.returnUrl}})
132
- }
133
- </script>
91
+ <script setup>
92
+ import Tab from '@martyrs/src/components/Tab/Tab.vue'
93
+ import Field from '@martyrs/src/components/Field/Field.vue'
94
+ import FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'
95
+ import Button from '@martyrs/src/components/Button/Button.vue'
134
96
 
135
- <style lang="scss">
136
- .slide-fade-enter-active {
137
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
138
- }
97
+ import { computed, ref } from 'vue'
98
+ import { useRoute, useRouter } from 'vue-router'
99
+ import { useI18n } from 'vue-i18n'
100
+
101
+ import { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'
102
+ import { setError } from '@martyrs/src/modules/core/views/store/core.store.js'
103
+ import { withOtp } from '@martyrs/src/modules/auth/views/plugins/otp.plugin.js'
104
+ import $axios from '@martyrs/src/modules/core/views/utils/axios-instance.js'
105
+ import * as inputsValidation from '@martyrs/src/modules/auth/views/validations/inputs.validation'
106
+
107
+ const store = useStore()
108
+ const core = store.core || { state: {} }
109
+ const auth = store.auth
139
110
 
140
- .slide-fade-leave-active {
141
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
111
+ const route = useRoute()
112
+ const router = useRouter()
113
+ const { t } = useI18n({ useScope: 'global' })
142
114
 
143
- }
115
+ const email = ref('')
116
+ const phone = ref('')
117
+ const password = ref('')
118
+ const passwordRepeat = ref('')
144
119
 
145
- .slide-fade-enter-from,
146
- .slide-fade-leave-to {
147
- position: absolute;
148
- transform: translateX(20px);
149
- opacity: 0;
150
- left: 0;
151
- top: 0;
152
- }
120
+ const phoneValidation = ref(null)
121
+ const emailValidation = ref(null)
122
+ const passwordValidation = ref(null)
153
123
 
154
- .slide-fade-leave-to {
124
+ const availableTabs = computed(() => {
125
+ const tabs = [
126
+ { name: t('auth.signUp.phone'), value: 'phone' },
127
+ { name: t('auth.signUp.email'), value: 'email' }
128
+ ]
129
+ const excludeMethods = core.state?.options?.auth?.authMethodsExclude || []
130
+ return tabs.filter(tab => !excludeMethods.includes(tab.value))
131
+ })
132
+
133
+ const tabAuth = ref(availableTabs.value.length ? availableTabs.value[0].value : '')
134
+
135
+ async function onSubmit() {
136
+ // Validate identifier
137
+ if (tabAuth.value === 'phone') {
138
+ await inputsValidation.validateInputs(
139
+ phoneValidation,
140
+ inputsValidation.validatePhone,
141
+ phone.value,
142
+ 'Некорректный телефон'
143
+ )
144
+ }
145
+ if (tabAuth.value === 'email') {
146
+ await inputsValidation.validateInputs(
147
+ emailValidation,
148
+ inputsValidation.validateEmail,
149
+ email.value,
150
+ 'Некорректный email'
151
+ )
152
+ }
153
+
154
+ // Validate password
155
+ await inputsValidation.validateInputs(
156
+ passwordValidation,
157
+ inputsValidation.validatePassword,
158
+ password.value,
159
+ 'Некорректный пароль'
160
+ )
161
+
162
+ if (password.value !== passwordRepeat.value) {
163
+ setError({ response: { data: { errorCode: 'PASSWORDS_DO_NOT_MATCH' } } })
164
+ throw new Error('PASSWORDS_DO_NOT_MATCH')
165
+ }
166
+
167
+ // Signup with OTP verification
168
+ try {
169
+ const result = await withOtp(
170
+ (data) => $axios.post('/api/auth/signup', data),
171
+ {
172
+ email: tabAuth.value === 'email' ? email.value : undefined,
173
+ phone: tabAuth.value === 'phone' ? phone.value : undefined,
174
+ password: password.value,
175
+ type: tabAuth.value,
176
+ inviteCode: route.query.invite
177
+ }
178
+ )
179
+
180
+ // Success - save token and redirect
181
+ if (result.data?.accessToken) {
182
+ const Cookies = (await import('js-cookie')).default
183
+ Cookies.set('user', JSON.stringify(result.data), { path: '/', expires: 7 })
184
+ await auth.actions.initialize()
185
+
186
+ if (route.query.returnUrl) {
187
+ router.push({ path: route.query.returnUrl, query: { afterAuth: 'true' } })
188
+ } else {
189
+ router.push({ name: 'User Profile', params: { _id: result.data._id }, query: { afterAuth: 'true' } })
190
+ }
191
+ }
192
+ } catch (error) {
193
+ setError(error)
194
+ throw error
195
+ }
196
+ }
197
+ </script>
198
+
199
+ <style lang="scss">
200
+ .slide-fade-enter-active,
201
+ .slide-fade-leave-active {
202
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
203
+ }
155
204
 
156
- }
205
+ .slide-fade-enter-from,
206
+ .slide-fade-leave-to {
207
+ position: absolute;
208
+ transform: translateX(20px);
209
+ opacity: 0;
210
+ left: 0;
211
+ top: 0;
212
+ }
157
213
  </style>
@@ -0,0 +1,104 @@
1
+ import { h, reactive, render, defineAsyncComponent } from 'vue';
2
+
3
+ const OtpDialog = defineAsyncComponent(() =>
4
+ import('@martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue')
5
+ );
6
+
7
+ const state = reactive({
8
+ visible: false,
9
+ mode: 'single', // 'single' или 'dual'
10
+ challenge: null,
11
+ challenges: null,
12
+ resolve: null,
13
+ reject: null
14
+ });
15
+
16
+ export function showOtp(challenge) {
17
+ if (state.visible) {
18
+ return Promise.reject(new Error('OTP dialog already open'));
19
+ }
20
+
21
+ return new Promise((resolve, reject) => {
22
+ state.resolve = resolve;
23
+ state.reject = reject;
24
+ state.challenge = challenge;
25
+ state.mode = 'single';
26
+ state.visible = true;
27
+ });
28
+ }
29
+
30
+ export function showDualOtp(challenges) {
31
+ if (state.visible) {
32
+ return Promise.reject(new Error('OTP dialog already open'));
33
+ }
34
+
35
+ return new Promise((resolve, reject) => {
36
+ state.resolve = resolve;
37
+ state.reject = reject;
38
+ state.challenges = challenges;
39
+ state.mode = 'dual';
40
+ state.visible = true;
41
+ });
42
+ }
43
+
44
+ export function closeOtp(code) {
45
+ state.visible = false;
46
+ state.resolve?.(code);
47
+ state.resolve = state.reject = null;
48
+ }
49
+
50
+ export function closeDualOtp(codes) {
51
+ state.visible = false;
52
+ state.resolve?.(codes);
53
+ state.resolve = state.reject = null;
54
+ }
55
+
56
+ export function cancelOtp() {
57
+ state.visible = false;
58
+ state.reject?.(new Error('OTP cancelled'));
59
+ state.resolve = state.reject = null;
60
+ }
61
+
62
+ export async function withOtp(makeRequest, data) {
63
+ const result = await makeRequest(data);
64
+
65
+ if (result.data?.status === 'requires_otp') {
66
+ if (result.data.mode === 'dual') {
67
+ const codes = await showDualOtp(result.data.challenges);
68
+ return makeRequest({
69
+ ...data,
70
+ challenges: [
71
+ { challengeId: result.data.challenges[0].challengeId, code: codes[0] },
72
+ { challengeId: result.data.challenges[1].challengeId, code: codes[1] }
73
+ ]
74
+ });
75
+ } else {
76
+ const code = await showOtp(result.data.challenge);
77
+ return makeRequest({
78
+ ...data,
79
+ challengeId: result.data.challenge.challengeId,
80
+ otp: code
81
+ });
82
+ }
83
+ }
84
+
85
+ return result;
86
+ }
87
+
88
+ export default {
89
+ install(app) {
90
+ app.config.globalProperties.$showOtp = showOtp;
91
+ app.config.globalProperties.$showDualOtp = showDualOtp;
92
+
93
+ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
94
+ const container = document.createElement('div');
95
+ container.id = 'otp-dialog-host';
96
+ container.className = 'z-index-7';
97
+ document.body.appendChild(container);
98
+
99
+ const vnode = h(OtpDialog, { otpState: state, closeOtp, closeDualOtp, cancelOtp });
100
+ vnode.appContext = app._context;
101
+ render(vnode, container);
102
+ }
103
+ }
104
+ };
@@ -10,6 +10,7 @@ export function getAuthRoutes(options = {}) {
10
10
  basePath: 'auth',
11
11
  component: () => import(/* webpackChunkName: "auth-layout" */ '../components/layouts/Auth.vue'),
12
12
  meta: {
13
+ layoutKey: 'auth',
13
14
  title: {
14
15
  en: 'Аутентификация',
15
16
  ru: 'Authentication',
@@ -52,30 +53,6 @@ export function getAuthRoutes(options = {}) {
52
53
  },
53
54
  component: () => import(/* webpackChunkName: "signup" */ '../components/pages/SignUp.vue'),
54
55
  },
55
- {
56
- path: 'enter-code',
57
- name: 'Enter Code',
58
- beforeEnter: [requiresNoAuth, checkUser],
59
- meta: {
60
- title: {
61
- en: 'Enter Code',
62
- ru: 'Введите Код',
63
- },
64
- },
65
- component: () => import(/* webpackChunkName: "signup" */ '../components/pages/EnterCode.vue'),
66
- },
67
- {
68
- path: 'enter-password',
69
- name: 'Enter Password',
70
- beforeEnter: [requiresNoAuth, checkUser],
71
- meta: {
72
- title: {
73
- en: 'Enter Password',
74
- ru: 'Введите Пароль',
75
- },
76
- },
77
- component: () => import(/* webpackChunkName: "signup" */ '../components/pages/EnterPassword.vue'),
78
- },
79
56
  {
80
57
  path: 'invite',
81
58
  name: 'Invite',
@@ -133,18 +133,7 @@ export function getUsersRoutes(options = {}) {
133
133
  },
134
134
  component: () => import(/* webpackChunkName: "profile" */ '@martyrs/src/modules/organizations/components/pages/Organizations.vue'),
135
135
  },
136
- {
137
- path: 'wallet',
138
- name: 'User Wallet',
139
- meta: {
140
- title: {
141
- en: 'Wallet',
142
- ru: 'Кошелек',
143
- },
144
- },
145
- component: () => import(/* webpackChunkName: "profile" */ '@martyrs/src/modules/wallet/views/components/pages/Wallet.vue'),
146
- },
147
- ],
136
+ ],
148
137
  },
149
138
  ],
150
139
  }
@@ -8,8 +8,6 @@ import { reactive, watch } from 'vue';
8
8
  // Globals
9
9
  import { useSession, setError } from '@martyrs/src/modules/core/views/store/core.store.js';
10
10
  import wsManager from '@martyrs/src/modules/core/views/classes/ws.manager.js';
11
- // State
12
- import * as twofa from './twofa.js';
13
11
 
14
12
  // State
15
13
  const state = reactive({
@@ -203,72 +201,6 @@ const actions = {
203
201
  console.log('[AUTH] Disconnecting WebSocket on logout');
204
202
  wsManager.disconnect();
205
203
  },
206
-
207
- async resetPassword(user, type) {
208
- try {
209
- const response = await $axios.post('/api/auth/reset-password', {
210
- email: user.email,
211
- phone: user.phone,
212
- type,
213
- });
214
-
215
- Object.assign(twofa.state.code, {
216
- ...response.data,
217
- isSended: true,
218
- });
219
-
220
- return response.data;
221
- } catch (error) {
222
- setError(error);
223
- return Promise.reject(error);
224
- }
225
- },
226
-
227
- async updatePassword(user, type) {
228
- const { password, passwordRepeat } = state.user;
229
-
230
- if (password !== passwordRepeat) {
231
- const error = {
232
- response: {
233
- data: { errorCode: 'PASSWORDS_DO_NOT_MATCH' },
234
- },
235
- };
236
- setError(error);
237
- throw new Error(error.response.status);
238
- }
239
-
240
- try {
241
- const response = await $axios.post('/api/auth/update-password', {
242
- email: user.email,
243
- phone: user.phone,
244
- password: user.password,
245
- passwordRepeat: user.passwordRepeat,
246
- type,
247
- });
248
-
249
- if (response.data.accessToken) {
250
- setCookie('user', response.data);
251
- }
252
-
253
- Object.assign(state.user, {
254
- ...response.data,
255
- });
256
-
257
- Object.assign(state.access, {
258
- token: response.data.accessToken,
259
- status: true,
260
- });
261
-
262
- session.set(response.data);
263
-
264
- return response.data;
265
- } catch (error) {
266
- // Make sure cookie is removed on password update error
267
- await removeCookie('user');
268
- setError(error);
269
- return Promise.reject(error);
270
- }
271
- },
272
204
  };
273
205
 
274
206
  // Cookies
@@ -2,6 +2,7 @@ import $axios from '@martyrs/src/modules/core/views/utils/axios-instance.js';
2
2
  import { reactive } from 'vue';
3
3
  // Add import for global error handler
4
4
  import { setError } from '@martyrs/src/modules/core/views/store/core.store.js';
5
+ import { withOtp } from '../plugins/otp.plugin.js';
5
6
 
6
7
  const state = reactive({
7
8
  all: [],
@@ -57,11 +58,14 @@ const actions = {
57
58
 
58
59
  async update(user) {
59
60
  try {
60
- const response = await $axios.put(`/api/users/${user._id}`, user);
61
+ const response = await withOtp(
62
+ (data) => $axios.put(`/api/users/${data._id}`, data),
63
+ user
64
+ );
61
65
  mutations.set(response.data, 'current');
62
66
  return Promise.resolve(response.data);
63
67
  } catch (error) {
64
- setError(error); // Add global error handling
68
+ setError(error);
65
69
  return Promise.reject(error);
66
70
  }
67
71
  },