@vitnode/core 1.2.0-canary.51 → 1.2.0-canary.53
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/config/next.config.ts +3 -3
- package/dist/scripts/get-config.d.ts +2 -2
- package/dist/scripts/get-config.d.ts.map +1 -1
- package/dist/scripts/plugin.d.ts.map +1 -1
- package/dist/scripts/prepare-database.d.ts.map +1 -1
- package/dist/scripts/prepare-plugins-files.d.ts.map +1 -1
- package/dist/scripts/scripts.js +4 -4
- package/dist/scripts/shared/file-utils.d.ts.map +1 -1
- package/dist/src/api/adapters/email/nodemailer.d.ts +1 -1
- package/dist/src/api/adapters/email/nodemailer.js +3 -3
- package/dist/src/api/adapters/email/resend.d.ts +1 -1
- package/dist/src/api/adapters/email/resend.js +2 -2
- package/dist/src/api/adapters/sso/discord.d.ts +1 -1
- package/dist/src/api/adapters/sso/discord.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/discord.js +21 -21
- package/dist/src/api/adapters/sso/facebook.d.ts +1 -1
- package/dist/src/api/adapters/sso/facebook.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/facebook.js +23 -23
- package/dist/src/api/adapters/sso/google.d.ts +1 -1
- package/dist/src/api/adapters/sso/google.d.ts.map +1 -1
- package/dist/src/api/adapters/sso/google.js +21 -21
- package/dist/src/api/config.d.ts +3 -3
- package/dist/src/api/config.d.ts.map +1 -1
- package/dist/src/api/config.js +11 -11
- package/dist/src/api/lib/check-plugin-id.js +8 -8
- package/dist/src/api/lib/logger-middleware.d.ts +1 -1
- package/dist/src/api/lib/logger-middleware.js +9 -9
- package/dist/src/api/lib/module.d.ts +2 -2
- package/dist/src/api/lib/plugin.d.ts +2 -2
- package/dist/src/api/lib/plugin.d.ts.map +1 -1
- package/dist/src/api/lib/route.d.ts +2 -2
- package/dist/src/api/lib/route.d.ts.map +1 -1
- package/dist/src/api/lib/route.js +1 -1
- package/dist/src/api/lib/with-pagination.d.ts +7 -7
- package/dist/src/api/lib/with-pagination.d.ts.map +1 -1
- package/dist/src/api/lib/with-pagination.js +37 -24
- package/dist/src/api/middlewares/captcha.middleware.d.ts +1 -1
- package/dist/src/api/middlewares/captcha.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/captcha.middleware.js +14 -13
- package/dist/src/api/middlewares/global.middleware.d.ts +12 -20
- package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/global.middleware.js +29 -28
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts +3 -3
- package/dist/src/api/middlewares/rate-limiter.middleware.d.ts.map +1 -1
- package/dist/src/api/middlewares/rate-limiter.middleware.js +4 -4
- package/dist/src/api/models/device.d.ts +1 -1
- package/dist/src/api/models/device.d.ts.map +1 -1
- package/dist/src/api/models/device.js +13 -13
- package/dist/src/api/models/email.d.ts +27 -11
- package/dist/src/api/models/email.d.ts.map +1 -1
- package/dist/src/api/models/email.js +35 -22
- package/dist/src/api/models/password.d.ts +4 -0
- package/dist/src/api/models/password.d.ts.map +1 -1
- package/dist/src/api/models/password.js +15 -7
- package/dist/src/api/models/session-admin.d.ts +2 -1
- package/dist/src/api/models/session-admin.d.ts.map +1 -1
- package/dist/src/api/models/session-admin.js +19 -19
- package/dist/src/api/models/session.d.ts +2 -1
- package/dist/src/api/models/session.d.ts.map +1 -1
- package/dist/src/api/models/session.js +17 -17
- package/dist/src/api/models/sso.d.ts +1 -1
- package/dist/src/api/models/sso.d.ts.map +1 -1
- package/dist/src/api/models/sso.js +24 -24
- package/dist/src/api/models/user/get-user-by-id.d.ts +2 -1
- package/dist/src/api/models/user/get-user-by-id.d.ts.map +1 -1
- package/dist/src/api/models/user/get-user-by-id.js +3 -2
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-in-with-passwords.js +1 -1
- package/dist/src/api/models/user/sign-up.d.ts +1 -1
- package/dist/src/api/models/user/sign-up.d.ts.map +1 -1
- package/dist/src/api/models/user/sign-up.js +13 -14
- package/dist/src/api/models/user.d.ts +1 -0
- package/dist/src/api/models/user.d.ts.map +1 -1
- package/dist/src/api/modules/admin/admin.module.d.ts +3 -3
- package/dist/src/api/modules/admin/admin.module.js +1 -1
- package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts +1 -1
- package/dist/src/api/modules/admin/debug/debug.admin.module.js +1 -1
- package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts +2 -2
- package/dist/src/api/modules/admin/debug/routes/logs.route.js +16 -16
- package/dist/src/api/modules/admin/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/admin/routes/session.route.js +7 -7
- package/dist/src/api/modules/admin/users/routes/list.route.d.ts +2 -2
- package/dist/src/api/modules/admin/users/routes/list.route.js +12 -12
- package/dist/src/api/modules/admin/users/routes/users.route.d.ts +2 -2
- package/dist/src/api/modules/admin/users/routes/users.route.js +15 -15
- package/dist/src/api/modules/admin/users/users.admin.module.d.ts +1 -1
- package/dist/src/api/modules/admin/users/users.admin.module.js +1 -1
- package/dist/src/api/modules/middleware/middleware.module.d.ts +1 -1
- package/dist/src/api/modules/middleware/middleware.module.js +1 -1
- package/dist/src/api/modules/middleware/route.d.ts +2 -2
- package/dist/src/api/modules/middleware/route.js +12 -12
- package/dist/src/api/modules/users/routes/change-password.route.d.ts +52 -0
- package/dist/src/api/modules/users/routes/change-password.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/change-password.route.js +58 -0
- package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts +42 -0
- package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts.map +1 -0
- package/dist/src/api/modules/users/routes/reset-passowrd.route.js +91 -0
- package/dist/src/api/modules/users/routes/session.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/session.route.js +6 -6
- package/dist/src/api/modules/users/routes/sign-in.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/sign-in.route.js +10 -10
- package/dist/src/api/modules/users/routes/sign-out.route.d.ts +2 -2
- package/dist/src/api/modules/users/routes/sign-out.route.js +7 -7
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts +9 -3
- package/dist/src/api/modules/users/routes/sign-up.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/sign-up.route.js +18 -12
- package/dist/src/api/modules/users/routes/test.route.d.ts +3 -3
- package/dist/src/api/modules/users/routes/test.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/routes/test.route.js +9 -15
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +6 -3
- package/dist/src/api/modules/users/sso/routes/callback.route.d.ts.map +1 -1
- package/dist/src/api/modules/users/sso/routes/callback.route.js +10 -7
- package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +2 -2
- package/dist/src/api/modules/users/sso/routes/create-url.route.js +6 -6
- package/dist/src/api/modules/users/sso/sso.module.d.ts +6 -3
- package/dist/src/api/modules/users/sso/sso.module.d.ts.map +1 -1
- package/dist/src/api/modules/users/sso/sso.module.js +1 -1
- package/dist/src/api/modules/users/users.module.d.ts +103 -11
- package/dist/src/api/modules/users/users.module.d.ts.map +1 -1
- package/dist/src/api/modules/users/users.module.js +6 -2
- package/dist/src/app/login/page.d.ts +1 -1
- package/dist/src/app/login/page.js +2 -2
- package/dist/src/app/login/reset-password/page.d.ts +9 -0
- package/dist/src/app/login/reset-password/page.d.ts.map +1 -0
- package/dist/src/app/login/reset-password/page.js +18 -0
- package/dist/src/app/register/page.d.ts +1 -1
- package/dist/src/app/register/page.js +2 -2
- package/dist/src/app_admin/core/debug/page.d.ts +1 -1
- package/dist/src/app_admin/core/debug/page.js +8 -8
- package/dist/src/app_admin/core/users/page.d.ts +2 -2
- package/dist/src/app_admin/core/users/page.d.ts.map +1 -1
- package/dist/src/app_admin/core/users/page.js +7 -7
- package/dist/src/components/avatar.d.ts +1 -1
- package/dist/src/components/avatar.js +1 -1
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts +2 -2
- package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +5 -5
- package/dist/src/components/confirm-action/content.d.ts.map +1 -1
- package/dist/src/components/confirm-action/content.js +3 -4
- package/dist/src/components/date-format.js +8 -8
- package/dist/src/components/form/auto-form.d.ts +17 -16
- package/dist/src/components/form/auto-form.d.ts.map +1 -1
- package/dist/src/components/form/auto-form.js +15 -13
- package/dist/src/components/form/common/desc.js +1 -1
- package/dist/src/components/form/common/label.d.ts +4 -2
- package/dist/src/components/form/common/label.d.ts.map +1 -1
- package/dist/src/components/form/common/label.js +14 -4
- package/dist/src/components/form/fields/checkbox.d.ts +3 -3
- package/dist/src/components/form/fields/checkbox.d.ts.map +1 -1
- package/dist/src/components/form/fields/checkbox.js +2 -1
- package/dist/src/components/form/fields/combobox-async.d.ts +4 -4
- package/dist/src/components/form/fields/combobox-async.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox-async.js +31 -24
- package/dist/src/components/form/fields/combobox.d.ts +4 -4
- package/dist/src/components/form/fields/combobox.d.ts.map +1 -1
- package/dist/src/components/form/fields/combobox.js +8 -8
- package/dist/src/components/form/fields/input.d.ts +3 -3
- package/dist/src/components/form/fields/input.d.ts.map +1 -1
- package/dist/src/components/form/fields/input.js +4 -3
- package/dist/src/components/form/fields/radio-group.d.ts +4 -4
- package/dist/src/components/form/fields/radio-group.d.ts.map +1 -1
- package/dist/src/components/form/fields/radio-group.js +2 -2
- package/dist/src/components/form/fields/select.d.ts +4 -4
- package/dist/src/components/form/fields/select.d.ts.map +1 -1
- package/dist/src/components/form/fields/select.js +4 -4
- package/dist/src/components/form/fields/switch.d.ts +3 -3
- package/dist/src/components/form/fields/switch.d.ts.map +1 -1
- package/dist/src/components/form/fields/switch.js +2 -1
- package/dist/src/components/form/fields/textarea.d.ts +4 -4
- package/dist/src/components/form/fields/textarea.d.ts.map +1 -1
- package/dist/src/components/form/fields/textarea.js +3 -3
- package/dist/src/components/i18n-provider.d.ts +2 -2
- package/dist/src/components/i18n-provider.js +3 -3
- package/dist/src/components/logo-vitnode.d.ts.map +1 -1
- package/dist/src/components/logo-vitnode.js +8 -2
- package/dist/src/components/switchers/langs/language-swietcher.d.ts +1 -1
- package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +1 -1
- package/dist/src/components/switchers/langs/language-swietcher.js +3 -3
- package/dist/src/components/switchers/themes/theme-switcher.js +4 -4
- package/dist/src/components/table/content.d.ts +1 -1
- package/dist/src/components/table/content.d.ts.map +1 -1
- package/dist/src/components/table/content.js +5 -5
- package/dist/src/components/table/data-table.d.ts +7 -7
- package/dist/src/components/table/data-table.d.ts.map +1 -1
- package/dist/src/components/table/data-table.js +22 -15
- package/dist/src/components/table/order-table-head.d.ts +4 -4
- package/dist/src/components/table/order-table-head.d.ts.map +1 -1
- package/dist/src/components/table/order-table-head.js +20 -9
- package/dist/src/components/table/pagination.js +19 -19
- package/dist/src/components/ui/accordion.d.ts +2 -2
- package/dist/src/components/ui/accordion.d.ts.map +1 -1
- package/dist/src/components/ui/accordion.js +4 -5
- package/dist/src/components/ui/alert-dialog.d.ts +7 -7
- package/dist/src/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/src/components/ui/alert-dialog.js +13 -14
- package/dist/src/components/ui/alert.d.ts +6 -6
- package/dist/src/components/ui/alert.d.ts.map +1 -1
- package/dist/src/components/ui/alert.js +6 -7
- package/dist/src/components/ui/badge.d.ts +4 -4
- package/dist/src/components/ui/badge.d.ts.map +1 -1
- package/dist/src/components/ui/badge.js +7 -8
- package/dist/src/components/ui/button-client.d.ts +1 -1
- package/dist/src/components/ui/button-client.js +9 -9
- package/dist/src/components/ui/button.d.ts +9 -9
- package/dist/src/components/ui/button.d.ts.map +1 -1
- package/dist/src/components/ui/button.js +14 -15
- package/dist/src/components/ui/card.d.ts +8 -8
- package/dist/src/components/ui/card.d.ts.map +1 -1
- package/dist/src/components/ui/card.js +7 -8
- package/dist/src/components/ui/checkbox.d.ts +2 -2
- package/dist/src/components/ui/checkbox.d.ts.map +1 -1
- package/dist/src/components/ui/checkbox.js +2 -3
- package/dist/src/components/ui/collapsible.d.ts +1 -1
- package/dist/src/components/ui/collapsible.js +1 -1
- package/dist/src/components/ui/command.d.ts +4 -4
- package/dist/src/components/ui/command.d.ts.map +1 -1
- package/dist/src/components/ui/command.js +9 -10
- package/dist/src/components/ui/context-menu.d.ts +4 -4
- package/dist/src/components/ui/context-menu.d.ts.map +1 -1
- package/dist/src/components/ui/context-menu.js +7 -8
- package/dist/src/components/ui/dialog.d.ts +6 -6
- package/dist/src/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/components/ui/dialog.js +16 -16
- package/dist/src/components/ui/drawer.d.ts +4 -4
- package/dist/src/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/components/ui/drawer.js +7 -8
- package/dist/src/components/ui/dropdown-menu.d.ts +4 -4
- package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/src/components/ui/dropdown-menu.js +8 -9
- package/dist/src/components/ui/form.d.ts +10 -10
- package/dist/src/components/ui/form.d.ts.map +1 -1
- package/dist/src/components/ui/form.js +15 -15
- package/dist/src/components/ui/header-content.js +1 -1
- package/dist/src/components/ui/hover-card.d.ts +2 -2
- package/dist/src/components/ui/hover-card.d.ts.map +1 -1
- package/dist/src/components/ui/hover-card.js +3 -4
- package/dist/src/components/ui/input-otp.d.ts +5 -5
- package/dist/src/components/ui/input-otp.d.ts.map +1 -1
- package/dist/src/components/ui/input-otp.js +6 -7
- package/dist/src/components/ui/input.d.ts +2 -2
- package/dist/src/components/ui/input.d.ts.map +1 -1
- package/dist/src/components/ui/input.js +1 -2
- package/dist/src/components/ui/label.d.ts +2 -2
- package/dist/src/components/ui/label.d.ts.map +1 -1
- package/dist/src/components/ui/label.js +2 -3
- package/dist/src/components/ui/loader.js +3 -3
- package/dist/src/components/ui/menubar.d.ts +4 -4
- package/dist/src/components/ui/menubar.d.ts.map +1 -1
- package/dist/src/components/ui/menubar.js +11 -12
- package/dist/src/components/ui/navigation-menu.d.ts +2 -2
- package/dist/src/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/src/components/ui/navigation-menu.js +10 -11
- package/dist/src/components/ui/popover.d.ts +3 -3
- package/dist/src/components/ui/popover.d.ts.map +1 -1
- package/dist/src/components/ui/popover.js +4 -4
- package/dist/src/components/ui/progress.d.ts +2 -2
- package/dist/src/components/ui/progress.d.ts.map +1 -1
- package/dist/src/components/ui/progress.js +2 -3
- package/dist/src/components/ui/radio-group.d.ts +2 -2
- package/dist/src/components/ui/radio-group.d.ts.map +1 -1
- package/dist/src/components/ui/radio-group.js +3 -4
- package/dist/src/components/ui/select.d.ts +3 -3
- package/dist/src/components/ui/select.d.ts.map +1 -1
- package/dist/src/components/ui/select.js +9 -10
- package/dist/src/components/ui/separator.d.ts +2 -2
- package/dist/src/components/ui/separator.d.ts.map +1 -1
- package/dist/src/components/ui/separator.js +3 -4
- package/dist/src/components/ui/sheet.d.ts +5 -5
- package/dist/src/components/ui/sheet.d.ts.map +1 -1
- package/dist/src/components/ui/sheet.js +8 -9
- package/dist/src/components/ui/sidebar.d.ts +31 -31
- package/dist/src/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/components/ui/sidebar.js +67 -69
- package/dist/src/components/ui/skeleton.d.ts +1 -1
- package/dist/src/components/ui/skeleton.js +1 -1
- package/dist/src/components/ui/slider.d.ts +2 -2
- package/dist/src/components/ui/slider.d.ts.map +1 -1
- package/dist/src/components/ui/slider.js +16 -8
- package/dist/src/components/ui/sonner.d.ts +1 -1
- package/dist/src/components/ui/sonner.d.ts.map +1 -1
- package/dist/src/components/ui/sonner.js +6 -6
- package/dist/src/components/ui/switch.d.ts +2 -2
- package/dist/src/components/ui/switch.d.ts.map +1 -1
- package/dist/src/components/ui/switch.js +3 -4
- package/dist/src/components/ui/table.d.ts +9 -9
- package/dist/src/components/ui/table.d.ts.map +1 -1
- package/dist/src/components/ui/table.js +8 -9
- package/dist/src/components/ui/tabs.d.ts +2 -2
- package/dist/src/components/ui/tabs.d.ts.map +1 -1
- package/dist/src/components/ui/tabs.js +4 -5
- package/dist/src/components/ui/textarea.d.ts +2 -2
- package/dist/src/components/ui/textarea.d.ts.map +1 -1
- package/dist/src/components/ui/textarea.js +1 -2
- package/dist/src/components/ui/toggle-group.d.ts +4 -4
- package/dist/src/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/src/components/ui/toggle-group.js +6 -6
- package/dist/src/components/ui/toggle.d.ts +3 -3
- package/dist/src/components/ui/toggle.d.ts.map +1 -1
- package/dist/src/components/ui/toggle.js +8 -9
- package/dist/src/components/ui/tooltip.d.ts +3 -3
- package/dist/src/components/ui/tooltip.d.ts.map +1 -1
- package/dist/src/components/ui/tooltip.js +8 -10
- package/dist/src/config.js +2 -2
- package/dist/src/database/admins.js +10 -10
- package/dist/src/database/languages.js +7 -7
- package/dist/src/database/logs.js +9 -9
- package/dist/src/database/moderators.js +5 -5
- package/dist/src/database/roles.js +1 -1
- package/dist/src/database/sessions.js +6 -6
- package/dist/src/database/users.d.ts +21 -2
- package/dist/src/database/users.d.ts.map +1 -1
- package/dist/src/database/users.js +18 -15
- package/dist/src/drizzle.config.d.ts +2 -2
- package/dist/src/drizzle.config.d.ts.map +1 -1
- package/dist/src/drizzle.config.js +19 -12
- package/dist/src/emails/default-template.d.ts +34 -22
- package/dist/src/emails/default-template.d.ts.map +1 -1
- package/dist/src/emails/default-template.js +61 -66
- package/dist/src/emails/reset-password.d.ts +56 -0
- package/dist/src/emails/reset-password.d.ts.map +1 -0
- package/dist/src/emails/reset-password.js +132 -0
- package/dist/src/emails/ui/button.d.ts +9 -0
- package/dist/src/emails/ui/button.d.ts.map +1 -0
- package/dist/src/emails/ui/button.js +36 -0
- package/dist/src/emails/ui/card.d.ts +8 -0
- package/dist/src/emails/ui/card.d.ts.map +1 -0
- package/dist/src/emails/ui/card.js +39 -0
- package/dist/src/hooks/use-before-unload.js +3 -3
- package/dist/src/hooks/use-captcha.d.ts +2 -2
- package/dist/src/hooks/use-captcha.d.ts.map +1 -1
- package/dist/src/hooks/use-captcha.js +64 -40
- package/dist/src/hooks/use-mobile.d.ts.map +1 -1
- package/dist/src/hooks/use-mobile.js +3 -4
- package/dist/src/lib/api/get-middleware-api.js +4 -4
- package/dist/src/lib/api/get-session-admin-api.js +5 -5
- package/dist/src/lib/api/get-session-api.js +4 -4
- package/dist/src/lib/colors.js +28 -19
- package/dist/src/lib/colors.test.js +60 -60
- package/dist/src/lib/config.js +3 -3
- package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts.map +1 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.js +1 -1
- package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +27 -27
- package/dist/src/lib/fetcher/core.d.ts +5 -5
- package/dist/src/lib/fetcher/core.d.ts.map +1 -1
- package/dist/src/lib/fetcher/core.js +16 -10
- package/dist/src/lib/fetcher/helpers-server.d.ts +1 -1
- package/dist/src/lib/fetcher/helpers-server.js +1 -1
- package/dist/src/lib/fetcher/helpers.test.js +17 -17
- package/dist/src/lib/fetcher/types.d.ts +26 -26
- package/dist/src/lib/fetcher/types.d.ts.map +1 -1
- package/dist/src/lib/fetcher-client.d.ts +4 -4
- package/dist/src/lib/fetcher-client.d.ts.map +1 -1
- package/dist/src/lib/fetcher-client.js +3 -3
- package/dist/src/lib/fetcher.d.ts +5 -5
- package/dist/src/lib/fetcher.d.ts.map +1 -1
- package/dist/src/lib/fetcher.js +4 -4
- package/dist/src/lib/helpers/auto-form.d.ts +3 -3
- package/dist/src/lib/helpers/auto-form.d.ts.map +1 -1
- package/dist/src/lib/helpers/auto-form.js +16 -15
- package/dist/src/lib/helpers/auto-form.test.js +129 -129
- package/dist/src/lib/navigation.d.ts +2 -2
- package/dist/src/lib/navigation.d.ts.map +1 -1
- package/dist/src/lib/plugin.d.ts +3 -3
- package/dist/src/lib/special-characters.js +1 -1
- package/dist/src/lib/special-characters.test.js +36 -36
- package/dist/src/lib/utils.d.ts +1 -1
- package/dist/src/tests/setup.d.ts +1 -1
- package/dist/src/views/admin/layouts/admin-layout.d.ts +1 -1
- package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/admin-layout.js +4 -8
- package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/item.js +11 -12
- package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts +1 -1
- package/dist/src/views/admin/layouts/sidebar/nav/nav.js +11 -11
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts +1 -1
- package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/sidebar/sidebar.js +1 -2
- package/dist/src/views/admin/layouts/sidebar/sign-out.js +1 -1
- package/dist/src/views/admin/layouts/user-bar/client.js +5 -5
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts +1 -1
- package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts.map +1 -1
- package/dist/src/views/admin/layouts/user-bar/user-bar.js +1 -1
- package/dist/src/views/admin/sign-in/sign-in-admin-view.js +3 -2
- package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +3 -3
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +10 -10
- package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +2 -2
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.js +15 -15
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +7 -7
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.js +7 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.d.ts +1 -1
- package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.js +3 -3
- package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.js +25 -25
- package/dist/src/views/admin/views/core/test.js +43 -43
- package/dist/src/views/admin/views/core/users/users-admin-view.d.ts.map +1 -1
- package/dist/src/views/admin/views/core/users/users-admin-view.js +13 -14
- package/dist/src/views/auth/password-reset/change-password-form/form.d.ts +5 -0
- package/dist/src/views/auth/password-reset/change-password-form/form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/change-password-form/form.js +48 -0
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts +6 -0
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/change-password-form/mutation-api.js +22 -0
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts +11 -0
- package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/change-password-form/use-form.js +36 -0
- package/dist/src/views/auth/password-reset/form/form.d.ts +6 -0
- package/dist/src/views/auth/password-reset/form/form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/form/form.js +104 -0
- package/dist/src/views/auth/password-reset/form/mutation-api.d.ts +7 -0
- package/dist/src/views/auth/password-reset/form/mutation-api.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/form/mutation-api.js +21 -0
- package/dist/src/views/auth/password-reset/form/use-form.d.ts +12 -0
- package/dist/src/views/auth/password-reset/form/use-form.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/form/use-form.js +33 -0
- package/dist/src/views/auth/password-reset/password-reset-view.d.ts +7 -0
- package/dist/src/views/auth/password-reset/password-reset-view.d.ts.map +1 -0
- package/dist/src/views/auth/password-reset/password-reset-view.js +37 -0
- package/dist/src/views/auth/sign-in/form/form.d.ts +2 -1
- package/dist/src/views/auth/sign-in/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/form/form.js +15 -10
- package/dist/src/views/auth/sign-in/form/mutation-api.d.ts +2 -2
- package/dist/src/views/auth/sign-in/form/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/form/mutation-api.js +10 -10
- package/dist/src/views/auth/sign-in/form/use-form.d.ts +2 -2
- package/dist/src/views/auth/sign-in/form/use-form.js +11 -11
- package/dist/src/views/auth/sign-in/sign-in-view.d.ts.map +1 -1
- package/dist/src/views/auth/sign-in/sign-in-view.js +13 -7
- package/dist/src/views/auth/{components → sign-up/components}/password-input.d.ts +3 -3
- package/dist/src/views/auth/sign-up/components/password-input.d.ts.map +1 -0
- package/dist/src/views/auth/{components → sign-up/components}/password-input.js +13 -14
- package/dist/src/views/auth/sign-up/email-confirmation-view.js +4 -4
- package/dist/src/views/auth/sign-up/form/form.d.ts +2 -2
- package/dist/src/views/auth/sign-up/form/form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/form.js +20 -33
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts +3 -3
- package/dist/src/views/auth/sign-up/form/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/mutation-api.js +6 -6
- package/dist/src/views/auth/sign-up/form/use-form.d.ts +3 -8
- package/dist/src/views/auth/sign-up/form/use-form.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/form/use-form.js +27 -24
- package/dist/src/views/auth/sign-up/sign-up-view.js +6 -6
- package/dist/src/views/auth/sign-up/wrapper.d.ts +1 -1
- package/dist/src/views/auth/sign-up/wrapper.d.ts.map +1 -1
- package/dist/src/views/auth/sign-up/wrapper.js +5 -8
- package/dist/src/views/auth/sso/buttons/client.js +4 -4
- package/dist/src/views/auth/sso/buttons/mutation-api.js +5 -5
- package/dist/src/views/auth/sso/buttons/sso-buttons.js +2 -2
- package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/callback-sso-view.js +21 -7
- package/dist/src/views/auth/sso/callback/client/client.d.ts +3 -1
- package/dist/src/views/auth/sso/callback/client/client.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/client/client.js +36 -7
- package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts.map +1 -1
- package/dist/src/views/auth/sso/callback/client/mutation-api.js +11 -6
- package/dist/src/views/error/back-button.js +1 -1
- package/dist/src/views/error/error-view.d.ts +5 -3
- package/dist/src/views/error/error-view.d.ts.map +1 -1
- package/dist/src/views/error/error-view.js +25 -23
- package/dist/src/views/error/global-error-view.d.ts +3 -3
- package/dist/src/views/error/global-error-view.d.ts.map +1 -1
- package/dist/src/views/error/global-error-view.js +36 -44
- package/dist/src/views/layouts/provider.d.ts +4 -4
- package/dist/src/views/layouts/provider.d.ts.map +1 -1
- package/dist/src/views/layouts/provider.js +3 -3
- package/dist/src/views/layouts/root-layout.d.ts +3 -3
- package/dist/src/views/layouts/root-layout.d.ts.map +1 -1
- package/dist/src/views/layouts/root-layout.js +1 -2
- package/dist/src/views/layouts/theme/header/header.d.ts +2 -2
- package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/header.js +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.d.ts.map +1 -1
- package/dist/src/views/layouts/theme/header/user/auth/client.js +4 -4
- package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +8 -8
- package/dist/src/views/layouts/theme/header/user/user.js +4 -4
- package/dist/src/views/layouts/theme/layout.d.ts +2 -2
- package/dist/src/views/layouts/theme/layout.js +1 -1
- package/dist/src/vitnode.config.d.ts +16 -13
- package/dist/src/vitnode.config.d.ts.map +1 -1
- package/dist/src/vitnode.config.js +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -46
- package/src/app/login/page.tsx +5 -5
- package/src/app/login/reset-password/page.tsx +27 -0
- package/src/app/login/sso/[providerId]/page.tsx +1 -1
- package/src/app/register/page.tsx +5 -5
- package/src/app_admin/core/debug/page.tsx +14 -14
- package/src/app_admin/core/page.tsx +1 -1
- package/src/app_admin/core/test/page.tsx +1 -1
- package/src/app_admin/core/users/page.tsx +12 -13
- package/src/locales/en.json +42 -2
- package/dist/src/views/auth/components/password-input.d.ts.map +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { MailCheckIcon } from "lucide-react";
|
|
4
|
+
import { useTranslations } from "next-intl";
|
|
5
|
+
import { AutoForm } from "../../../../components/form/auto-form.js";
|
|
6
|
+
import { AutoFormInput } from "../../../../components/form/fields/input.js";
|
|
7
|
+
import { CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "../../../../components/ui/card.js";
|
|
8
|
+
import { Input } from "../../../../components/ui/input.js";
|
|
9
|
+
import { Label } from "../../../../components/ui/label.js";
|
|
10
|
+
import { useForm } from "./use-form.js";
|
|
11
|
+
function ConfirmationView({ email }) {
|
|
12
|
+
const t = useTranslations("core.auth.reset_password");
|
|
13
|
+
const tSignUp = useTranslations("core.auth.sign_up");
|
|
14
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
15
|
+
children: [
|
|
16
|
+
/*#__PURE__*/ _jsxs(CardHeader, {
|
|
17
|
+
className: "flex flex-col items-center text-center",
|
|
18
|
+
children: [
|
|
19
|
+
/*#__PURE__*/ _jsx("div", {
|
|
20
|
+
className: "mb-3 rounded-2xl border p-3",
|
|
21
|
+
children: /*#__PURE__*/ _jsx(MailCheckIcon, {
|
|
22
|
+
className: "size-8"
|
|
23
|
+
})
|
|
24
|
+
}),
|
|
25
|
+
/*#__PURE__*/ _jsx(CardTitle, {
|
|
26
|
+
className: "text-balance",
|
|
27
|
+
children: t("confirmation.title")
|
|
28
|
+
}),
|
|
29
|
+
/*#__PURE__*/ _jsx(CardDescription, {
|
|
30
|
+
className: "text-pretty",
|
|
31
|
+
children: t("confirmation.desc")
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
}),
|
|
35
|
+
/*#__PURE__*/ _jsxs(CardContent, {
|
|
36
|
+
className: "space-y-2",
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ _jsx(Label, {
|
|
39
|
+
htmlFor: "email",
|
|
40
|
+
children: tSignUp("email.label")
|
|
41
|
+
}),
|
|
42
|
+
/*#__PURE__*/ _jsx(Input, {
|
|
43
|
+
className: "w-full",
|
|
44
|
+
id: "email",
|
|
45
|
+
readOnly: true,
|
|
46
|
+
value: email
|
|
47
|
+
})
|
|
48
|
+
]
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ _jsx(CardFooter, {
|
|
51
|
+
children: /*#__PURE__*/ _jsx(CardDescription, {
|
|
52
|
+
children: t("confirmation.check_spam")
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export const PasswordResetForm = ({ captcha })=>{
|
|
59
|
+
const { formSchema, onSubmit, sentEmail } = useForm();
|
|
60
|
+
const t = useTranslations("core.auth.reset_password");
|
|
61
|
+
const tSignUp = useTranslations("core.auth.sign_up");
|
|
62
|
+
if (sentEmail) {
|
|
63
|
+
return /*#__PURE__*/ _jsx(ConfirmationView, {
|
|
64
|
+
email: sentEmail
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
68
|
+
children: [
|
|
69
|
+
/*#__PURE__*/ _jsxs(CardHeader, {
|
|
70
|
+
className: "text-center",
|
|
71
|
+
children: [
|
|
72
|
+
/*#__PURE__*/ _jsx(CardTitle, {
|
|
73
|
+
children: /*#__PURE__*/ _jsx("h1", {
|
|
74
|
+
children: t("title")
|
|
75
|
+
})
|
|
76
|
+
}),
|
|
77
|
+
/*#__PURE__*/ _jsx(CardDescription, {
|
|
78
|
+
children: t("desc")
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ _jsx(CardContent, {
|
|
83
|
+
children: /*#__PURE__*/ _jsx(AutoForm, {
|
|
84
|
+
captcha: captcha,
|
|
85
|
+
fields: [
|
|
86
|
+
{
|
|
87
|
+
id: "email",
|
|
88
|
+
component: (props)=>/*#__PURE__*/ _jsx(AutoFormInput, {
|
|
89
|
+
...props,
|
|
90
|
+
label: tSignUp("email.label")
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
formSchema: formSchema,
|
|
95
|
+
onSubmit: onSubmit,
|
|
96
|
+
submitButtonProps: {
|
|
97
|
+
className: "w-full",
|
|
98
|
+
children: t("submit")
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
]
|
|
103
|
+
});
|
|
104
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/password-reset/form/mutation-api.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,GAAU,0BAG/B;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;;cAcA,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use server";
|
|
2
|
+
import { usersModule } from "../../../../api/modules/users/users.module.js";
|
|
3
|
+
import { fetcher } from "../../../../lib/fetcher.js";
|
|
4
|
+
export const mutationApi = async ({ email, captchaToken })=>{
|
|
5
|
+
const res = await fetcher(usersModule, {
|
|
6
|
+
module: "users",
|
|
7
|
+
path: "/reset-password",
|
|
8
|
+
method: "post",
|
|
9
|
+
captchaToken,
|
|
10
|
+
args: {
|
|
11
|
+
body: {
|
|
12
|
+
email
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
if (res.status !== 201) {
|
|
17
|
+
return {
|
|
18
|
+
error: "internal_server_error"
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import type { AutoFormOnSubmit } from "../../../../components/form/auto-form";
|
|
3
|
+
export declare const useForm: () => {
|
|
4
|
+
formSchema: z.ZodObject<{
|
|
5
|
+
email: z.ZodDefault<z.ZodEmail>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
onSubmit: AutoFormOnSubmit<z.ZodObject<{
|
|
8
|
+
email: z.ZodDefault<z.ZodEmail>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
sentEmail: string;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=use-form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-form.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/password-reset/form/use-form.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAIpE,eAAO,MAAM,OAAO;;;;;;;;CA+BnB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useTranslations } from "next-intl";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { toast } from "sonner";
|
|
4
|
+
import z from "zod";
|
|
5
|
+
import { mutationApi } from "./mutation-api.js";
|
|
6
|
+
export const useForm = ()=>{
|
|
7
|
+
const t = useTranslations("core.auth.sign_up");
|
|
8
|
+
const tError = useTranslations("core.global.errors");
|
|
9
|
+
const [sentEmail, setSentEmail] = React.useState("");
|
|
10
|
+
const formSchema = z.object({
|
|
11
|
+
email: z.email({
|
|
12
|
+
message: t("email.invalid")
|
|
13
|
+
}).default("")
|
|
14
|
+
});
|
|
15
|
+
const onSubmit = async (data, _form, { captchaToken })=>{
|
|
16
|
+
const mutation = await mutationApi({
|
|
17
|
+
email: data.email,
|
|
18
|
+
captchaToken
|
|
19
|
+
});
|
|
20
|
+
if (mutation?.error) {
|
|
21
|
+
toast.error(tError("title"), {
|
|
22
|
+
description: tError("internal_server_error")
|
|
23
|
+
});
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
setSentEmail(data.email);
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
formSchema,
|
|
30
|
+
onSubmit,
|
|
31
|
+
sentEmail
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-reset-view.d.ts","sourceRoot":"","sources":["../../../../../src/views/auth/password-reset/password-reset-view.tsx"],"names":[],"mappings":"AASA,eAAO,MAAM,iBAAiB,GAAU,mBAErC;IACD,YAAY,EAAE,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC1D,qDA0BA,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { notFound } from "next/navigation";
|
|
3
|
+
import { I18nProvider } from "../../../components/i18n-provider.js";
|
|
4
|
+
import { Card } from "../../../components/ui/card.js";
|
|
5
|
+
import { getMiddlewareApi } from "../../../lib/api/get-middleware-api.js";
|
|
6
|
+
import { ChangePasswordForm } from "./change-password-form/form.js";
|
|
7
|
+
import { PasswordResetForm } from "./form/form.js";
|
|
8
|
+
export const PasswordResetView = async ({ searchParams })=>{
|
|
9
|
+
const [{ isEmail, captcha }, { token, userId }] = await Promise.all([
|
|
10
|
+
getMiddlewareApi(),
|
|
11
|
+
searchParams
|
|
12
|
+
]);
|
|
13
|
+
if (!isEmail) notFound();
|
|
14
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
15
|
+
className: "mx-auto flex min-h-[calc(100vh-4rem)] max-w-md flex-col justify-center px-4 py-16",
|
|
16
|
+
children: /*#__PURE__*/ _jsx(Card, {
|
|
17
|
+
children: token && userId ? /*#__PURE__*/ _jsx(I18nProvider, {
|
|
18
|
+
namespaces: [
|
|
19
|
+
"core.auth.sign_up",
|
|
20
|
+
"core.auth.change_password"
|
|
21
|
+
],
|
|
22
|
+
children: /*#__PURE__*/ _jsx(ChangePasswordForm, {
|
|
23
|
+
token: token,
|
|
24
|
+
userId: userId
|
|
25
|
+
})
|
|
26
|
+
}) : /*#__PURE__*/ _jsx(I18nProvider, {
|
|
27
|
+
namespaces: [
|
|
28
|
+
"core.auth.sign_up",
|
|
29
|
+
"core.auth.reset_password"
|
|
30
|
+
],
|
|
31
|
+
children: /*#__PURE__*/ _jsx(PasswordResetForm, {
|
|
32
|
+
captcha: captcha
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sign-in/form/form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sign-in/form/form.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,UAAU,GAAI,uBAGxB;IACD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB,4CAoDA,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { AlertCircle } from "lucide-react";
|
|
4
4
|
import { useTranslations } from "next-intl";
|
|
5
5
|
import { AutoForm } from "../../../../components/form/auto-form.js";
|
|
6
6
|
import { AutoFormInput } from "../../../../components/form/fields/input.js";
|
|
7
7
|
import { Alert, AlertDescription, AlertTitle } from "../../../../components/ui/alert.js";
|
|
8
|
+
import { Link } from "../../../../lib/navigation.js";
|
|
8
9
|
import { useFormSignIn } from "./use-form.js";
|
|
9
|
-
export const FormSignIn = ({ isAdmin })=>{
|
|
10
|
-
const t = useTranslations(
|
|
10
|
+
export const FormSignIn = ({ isAdmin, isEmail })=>{
|
|
11
|
+
const t = useTranslations("core.auth.sign_in");
|
|
11
12
|
const { onSubmit, error, formSchema } = useFormSignIn({
|
|
12
13
|
isAdmin
|
|
13
14
|
});
|
|
@@ -31,17 +32,21 @@ export const FormSignIn = ({ isAdmin })=>{
|
|
|
31
32
|
/*#__PURE__*/ _jsx(AutoForm, {
|
|
32
33
|
fields: [
|
|
33
34
|
{
|
|
34
|
-
id:
|
|
35
|
+
id: "email",
|
|
35
36
|
component: (props)=>/*#__PURE__*/ _jsx(AutoFormInput, {
|
|
36
|
-
label: t(
|
|
37
|
-
type: "email",
|
|
37
|
+
label: t("email.label"),
|
|
38
38
|
...props
|
|
39
39
|
})
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
id:
|
|
42
|
+
id: "password",
|
|
43
43
|
component: (props)=>/*#__PURE__*/ _jsx(AutoFormInput, {
|
|
44
|
-
label: t(
|
|
44
|
+
label: t("password.label"),
|
|
45
|
+
labelRight: isEmail ? /*#__PURE__*/ _jsx(Link, {
|
|
46
|
+
className: "text-primary hover:underline",
|
|
47
|
+
href: "/login/reset-password",
|
|
48
|
+
children: t("password.reset")
|
|
49
|
+
}) : undefined,
|
|
45
50
|
type: "password",
|
|
46
51
|
...props
|
|
47
52
|
})
|
|
@@ -50,8 +55,8 @@ export const FormSignIn = ({ isAdmin })=>{
|
|
|
50
55
|
formSchema: formSchema,
|
|
51
56
|
onSubmit: onSubmit,
|
|
52
57
|
submitButtonProps: {
|
|
53
|
-
className:
|
|
54
|
-
children: t(
|
|
58
|
+
className: "w-full",
|
|
59
|
+
children: t("submit")
|
|
55
60
|
}
|
|
56
61
|
})
|
|
57
62
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { z } from
|
|
2
|
-
import type { zodSignInSchema } from
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { zodSignInSchema } from "../../../../api/modules/users/routes/sign-in.route";
|
|
3
3
|
export declare const mutationApi: (input: z.infer<typeof zodSignInSchema> & {
|
|
4
4
|
isAdmin?: boolean;
|
|
5
5
|
}) => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sign-in/form/mutation-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mutation-api.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sign-in/form/mutation-api.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAMhF,eAAO,MAAM,WAAW,GACtB,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GAAG;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;;;;cA6BF,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use server";
|
|
2
2
|
import { revalidatePath } from "next/cache";
|
|
3
3
|
import { usersModule } from "../../../../api/modules/users/users.module.js";
|
|
4
4
|
import { fetcher } from "../../../../lib/fetcher.js";
|
|
5
5
|
import { redirect } from "../../../../lib/navigation.js";
|
|
6
6
|
export const mutationApi = async (input)=>{
|
|
7
7
|
const res = await fetcher(usersModule, {
|
|
8
|
-
path:
|
|
9
|
-
method:
|
|
10
|
-
module:
|
|
8
|
+
path: "/sign_in",
|
|
9
|
+
method: "post",
|
|
10
|
+
module: "users",
|
|
11
11
|
allowSaveCookies: true,
|
|
12
12
|
args: {
|
|
13
13
|
body: input
|
|
@@ -15,19 +15,19 @@ export const mutationApi = async (input)=>{
|
|
|
15
15
|
});
|
|
16
16
|
if (res.status === 403) {
|
|
17
17
|
return {
|
|
18
|
-
message:
|
|
18
|
+
message: "access_denied"
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
if (res.status !== 201) {
|
|
22
22
|
return {
|
|
23
|
-
message:
|
|
23
|
+
message: "Internal Server Error"
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
if (input.isAdmin) {
|
|
27
|
-
revalidatePath(
|
|
28
|
-
await redirect(
|
|
27
|
+
revalidatePath("/[locale]/admin", "layout");
|
|
28
|
+
await redirect("/admin/core");
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
revalidatePath(
|
|
32
|
-
await redirect(
|
|
31
|
+
revalidatePath("/[locale]/(main)", "layout");
|
|
32
|
+
await redirect("/");
|
|
33
33
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import type { AutoFormOnSubmit } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { AutoFormOnSubmit } from "../../../../components/form/auto-form";
|
|
3
3
|
export declare const useFormSignIn: ({ isAdmin }: {
|
|
4
4
|
isAdmin?: boolean;
|
|
5
5
|
}) => {
|
|
@@ -4,30 +4,30 @@ import { toast } from "sonner";
|
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { mutationApi } from "./mutation-api.js";
|
|
6
6
|
export const useFormSignIn = ({ isAdmin })=>{
|
|
7
|
-
const [error, setError] = React.useState(
|
|
8
|
-
const t = useTranslations(
|
|
9
|
-
const tErrors = useTranslations(
|
|
7
|
+
const [error, setError] = React.useState("");
|
|
8
|
+
const t = useTranslations("core.auth.sign_in");
|
|
9
|
+
const tErrors = useTranslations("core.global.errors");
|
|
10
10
|
const formSchema = z.object({
|
|
11
11
|
email: z.email({
|
|
12
|
-
message: t(
|
|
13
|
-
}).default(
|
|
12
|
+
message: t("email.invalid")
|
|
13
|
+
}).default(""),
|
|
14
14
|
password: z.string().min(1, {
|
|
15
|
-
message: t(
|
|
16
|
-
}).default(
|
|
15
|
+
message: t("password.required")
|
|
16
|
+
}).default("")
|
|
17
17
|
});
|
|
18
18
|
const onSubmit = async (values)=>{
|
|
19
|
-
setError(
|
|
19
|
+
setError("");
|
|
20
20
|
const mutation = await mutationApi({
|
|
21
21
|
...values,
|
|
22
22
|
isAdmin
|
|
23
23
|
});
|
|
24
24
|
if (!mutation?.message) return;
|
|
25
|
-
if (mutation?.message !==
|
|
25
|
+
if (mutation?.message !== "Internal Server Error") {
|
|
26
26
|
setError(mutation.message);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
toast.error(tErrors(
|
|
30
|
-
description: tErrors(
|
|
29
|
+
toast.error(tErrors("title"), {
|
|
30
|
+
description: tErrors("internal_server_error")
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sign-in-view.d.ts","sourceRoot":"","sources":["../../../../../src/views/auth/sign-in/sign-in-view.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sign-in-view.d.ts","sourceRoot":"","sources":["../../../../../src/views/auth/sign-in/sign-in-view.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,wDAsCtB,CAAC"}
|
|
@@ -2,13 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { getTranslations } from "next-intl/server";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Card, CardDescription } from "../../../components/ui/card.js";
|
|
5
|
+
import { getMiddlewareApi } from "../../../lib/api/get-middleware-api.js";
|
|
5
6
|
import { Link } from "../../../lib/navigation.js";
|
|
6
7
|
import { I18nProvider } from "../../../components/i18n-provider.js";
|
|
7
8
|
import { SSOButtons, SSOButtonsSkeleton } from "../sso/buttons/sso-buttons.js";
|
|
8
9
|
import { FormSignIn } from "./form/form.js";
|
|
9
10
|
export const SignInView = async ()=>{
|
|
10
|
-
const t = await
|
|
11
|
-
|
|
11
|
+
const [t, tGlobal, { isEmail }] = await Promise.all([
|
|
12
|
+
getTranslations("core.auth.sign_in"),
|
|
13
|
+
getTranslations("core.global"),
|
|
14
|
+
getMiddlewareApi()
|
|
15
|
+
]);
|
|
12
16
|
return /*#__PURE__*/ _jsx(I18nProvider, {
|
|
13
17
|
namespaces: "core.auth.sign_in",
|
|
14
18
|
children: /*#__PURE__*/ _jsx("div", {
|
|
@@ -24,14 +28,16 @@ export const SignInView = async ()=>{
|
|
|
24
28
|
children: [
|
|
25
29
|
/*#__PURE__*/ _jsx("h1", {
|
|
26
30
|
className: "text-2xl font-semibold leading-none tracking-tight",
|
|
27
|
-
children: tGlobal(
|
|
31
|
+
children: tGlobal("login")
|
|
28
32
|
}),
|
|
29
33
|
/*#__PURE__*/ _jsx(CardDescription, {
|
|
30
|
-
children: t(
|
|
34
|
+
children: t("desc")
|
|
31
35
|
})
|
|
32
36
|
]
|
|
33
37
|
}),
|
|
34
|
-
/*#__PURE__*/ _jsx(FormSignIn, {
|
|
38
|
+
/*#__PURE__*/ _jsx(FormSignIn, {
|
|
39
|
+
isEmail: isEmail
|
|
40
|
+
}),
|
|
35
41
|
/*#__PURE__*/ _jsx(React.Suspense, {
|
|
36
42
|
fallback: /*#__PURE__*/ _jsx(SSOButtonsSkeleton, {}),
|
|
37
43
|
children: /*#__PURE__*/ _jsx(SSOButtons, {})
|
|
@@ -40,9 +46,9 @@ export const SignInView = async ()=>{
|
|
|
40
46
|
}),
|
|
41
47
|
/*#__PURE__*/ _jsx("div", {
|
|
42
48
|
className: "text-accent-foreground p-6 text-center text-sm",
|
|
43
|
-
children: t.rich(
|
|
49
|
+
children: t.rich("do_not_have_account", {
|
|
44
50
|
link: (text)=>/*#__PURE__*/ _jsx(Link, {
|
|
45
|
-
className: "font-semibold",
|
|
51
|
+
className: "text-primary font-semibold",
|
|
46
52
|
href: "/register",
|
|
47
53
|
children: text
|
|
48
54
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import type { ItemAutoFormComponentProps } from
|
|
3
|
-
import { Input } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { ItemAutoFormComponentProps } from "../../../../components/form/auto-form";
|
|
3
|
+
import { Input } from "../../../../components/ui/input";
|
|
4
4
|
export declare const PasswordInput: ({ label, description: _, field, otherProps: { maxLength, minLength, pattern }, ...props }: ItemAutoFormComponentProps & Omit<React.ComponentProps<typeof Input>, "type">) => import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
//# sourceMappingURL=password-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-input.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sign-up/components/password-input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAI9E,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAQ9C,eAAO,MAAM,aAAa,GAAI,2FAM3B,0BAA0B,GAC3B,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAAE,MAAM,CAAC,4CA+EjD,CAAC"}
|
|
@@ -2,31 +2,30 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { CheckIcon, XIcon } from "lucide-react";
|
|
3
3
|
import { useTranslations } from "next-intl";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import { AutoFormLabel } from "
|
|
6
|
-
import { FormControl, FormItem, FormMessage } from "
|
|
7
|
-
import { Input } from "
|
|
8
|
-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "
|
|
9
|
-
export const PasswordInput = ({ label,
|
|
10
|
-
|
|
11
|
-
const t = useTranslations('core.auth.sign_up');
|
|
5
|
+
import { AutoFormLabel } from "../../../../components/form/common/label.js";
|
|
6
|
+
import { FormControl, FormItem, FormMessage } from "../../../../components/ui/form.js";
|
|
7
|
+
import { Input } from "../../../../components/ui/input.js";
|
|
8
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../../../components/ui/tooltip.js";
|
|
9
|
+
export const PasswordInput = ({ label, description: _, field, otherProps: { maxLength, minLength, pattern }, ...props })=>{
|
|
10
|
+
const t = useTranslations("core.auth.sign_up");
|
|
12
11
|
const [openTooltip, setOpenTooltip] = React.useState(false);
|
|
13
|
-
const value = field.value ??
|
|
12
|
+
const value = field.value ?? "";
|
|
14
13
|
const regexArray = [
|
|
15
14
|
{
|
|
16
15
|
regex: /^.{8,}$/.test(value),
|
|
17
|
-
id:
|
|
16
|
+
id: "min_length"
|
|
18
17
|
},
|
|
19
18
|
{
|
|
20
19
|
regex: /[A-Z]/.test(value),
|
|
21
|
-
id:
|
|
20
|
+
id: "uppercase"
|
|
22
21
|
},
|
|
23
22
|
{
|
|
24
23
|
regex: /\d/.test(value),
|
|
25
|
-
id:
|
|
24
|
+
id: "number"
|
|
26
25
|
},
|
|
27
26
|
{
|
|
28
27
|
regex: /\W|_/.test(value),
|
|
29
|
-
id:
|
|
28
|
+
id: "special_char"
|
|
30
29
|
}
|
|
31
30
|
];
|
|
32
31
|
return /*#__PURE__*/ _jsxs(FormItem, {
|
|
@@ -58,7 +57,7 @@ description: _, field, otherProps: { maxLength, minLength, pattern }, ...props }
|
|
|
58
57
|
props.onChange?.(e);
|
|
59
58
|
},
|
|
60
59
|
pattern: pattern ?? props.pattern,
|
|
61
|
-
value: field.value ??
|
|
60
|
+
value: field.value ?? "",
|
|
62
61
|
...props
|
|
63
62
|
})
|
|
64
63
|
})
|
|
@@ -69,7 +68,7 @@ description: _, field, otherProps: { maxLength, minLength, pattern }, ...props }
|
|
|
69
68
|
children: [
|
|
70
69
|
/*#__PURE__*/ _jsx("span", {
|
|
71
70
|
className: "text-based font-semibold",
|
|
72
|
-
children: t(
|
|
71
|
+
children: t("password.requirements.label")
|
|
73
72
|
}),
|
|
74
73
|
/*#__PURE__*/ _jsx("ul", {
|
|
75
74
|
className: "space-y-1",
|
|
@@ -3,7 +3,7 @@ import { Mail, MailboxIcon } from "lucide-react";
|
|
|
3
3
|
import { useTranslations } from "next-intl";
|
|
4
4
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../../components/ui/card.js";
|
|
5
5
|
export const EmailConfirmationView = ({ email })=>{
|
|
6
|
-
const t = useTranslations(
|
|
6
|
+
const t = useTranslations("core.auth.sign_up.email_confirmation");
|
|
7
7
|
return /*#__PURE__*/ _jsxs(Card, {
|
|
8
8
|
className: "w-full max-w-md p-6",
|
|
9
9
|
children: [
|
|
@@ -18,11 +18,11 @@ export const EmailConfirmationView = ({ email })=>{
|
|
|
18
18
|
}),
|
|
19
19
|
/*#__PURE__*/ _jsx(CardTitle, {
|
|
20
20
|
className: "text-2xl font-bold",
|
|
21
|
-
children: t(
|
|
21
|
+
children: t("title")
|
|
22
22
|
}),
|
|
23
23
|
/*#__PURE__*/ _jsx(CardDescription, {
|
|
24
24
|
className: "text-base",
|
|
25
|
-
children: t(
|
|
25
|
+
children: t("desc")
|
|
26
26
|
})
|
|
27
27
|
]
|
|
28
28
|
}),
|
|
@@ -46,7 +46,7 @@ export const EmailConfirmationView = ({ email })=>{
|
|
|
46
46
|
}),
|
|
47
47
|
/*#__PURE__*/ _jsx("p", {
|
|
48
48
|
className: "text-muted-foreground text-center text-sm",
|
|
49
|
-
children: t(
|
|
49
|
+
children: t("check_spam")
|
|
50
50
|
})
|
|
51
51
|
]
|
|
52
52
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { z } from
|
|
2
|
-
import type { routeMiddlewareSchema } from
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import type { routeMiddlewareSchema } from "../../../../api/modules/middleware/route";
|
|
3
3
|
export declare const FormSignUp: ({ isEmail, captcha, }: {
|
|
4
4
|
captcha: z.infer<typeof routeMiddlewareSchema>["captcha"];
|
|
5
5
|
isEmail: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sign-up/form/form.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../../../../../src/views/auth/sign-up/form/form.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAc5E,eAAO,MAAM,UAAU,GAAI,uBAGxB;IACD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1D,OAAO,EAAE,OAAO,CAAC;CAClB,4CAuFA,CAAC"}
|