@tulip-systems/core 0.5.13 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/client.d.mts +5 -4
- package/dist/auth/client.mjs +6 -5
- package/dist/auth.mjs +2 -2
- package/dist/components/client.mjs +2 -2
- package/dist/components/common/icons.d.mts +52 -52
- package/dist/components/common/status.d.mts +3 -3
- package/dist/components/editor/components/content.client.d.mts +2 -2
- package/dist/components/editor/components/editor.client.d.mts +6 -6
- package/dist/components/editor/components/editor.client.d.mts.map +1 -1
- package/dist/components/editor/components/menu.client.d.mts +3 -3
- package/dist/components/header/back-button.client.d.mts +2 -2
- package/dist/components/header/bottom-bar.client.d.mts +3 -3
- package/dist/components/header/breadcrumbs.client.d.mts +7 -7
- package/dist/components/header/header.client.d.mts +2 -2
- package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
- package/dist/components/header/top-bar.client.d.mts +4 -4
- package/dist/components/layouts/admin-content.client.d.mts +2 -2
- package/dist/components/layouts/admin-error-pages.d.mts +4 -4
- package/dist/components/layouts/admin-layout.d.mts +2 -2
- package/dist/components/layouts/admin-layout.mjs +1 -1
- package/dist/components/layouts/admin-layout.mjs.map +1 -1
- package/dist/components/layouts/admin-loading.d.mts +2 -2
- package/dist/components/layouts/empty-page.d.mts +4 -4
- package/dist/components/layouts/error-page.d.mts +9 -9
- package/dist/components/layouts/error-sections.d.mts +5 -5
- package/dist/components/layouts/list-layout.d.mts +2 -2
- package/dist/components/layouts/providers.client.d.mts +2 -2
- package/dist/components/layouts/root-error-pages.d.mts +2 -2
- package/dist/components/layouts/root-layout.server.d.mts +4 -4
- package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
- package/dist/components/layouts/root-loading.d.mts +2 -2
- package/dist/components/layouts/tab-layout.d.mts +2 -2
- package/dist/components/lists/data-list.d.mts +5 -5
- package/dist/components/lists/data-stack.d.mts +8 -8
- package/dist/components/navigation/admin-sidebar-header.client.mjs +3 -2
- package/dist/components/navigation/admin-sidebar-header.client.mjs.map +1 -1
- package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
- package/dist/components/ui/accordion.d.mts +5 -5
- package/dist/components/ui/alert-dialog.d.mts +12 -12
- package/dist/components/ui/alert.d.mts +6 -6
- package/dist/components/ui/aspect-ratio.d.mts +2 -2
- package/dist/components/ui/avatar.client.d.mts +4 -4
- package/dist/components/ui/badge.d.mts +4 -4
- package/dist/components/ui/breadcrumb.d.mts +8 -8
- package/dist/components/ui/button.d.mts +4 -4
- package/dist/components/ui/calendar.d.mts +3 -3
- package/dist/components/ui/card.d.mts +7 -7
- package/dist/components/ui/carousel.d.mts +6 -6
- package/dist/components/ui/chart.client.d.mts +5 -5
- package/dist/components/ui/checkbox.d.mts +2 -2
- package/dist/components/ui/collapsible.client.d.mts +4 -4
- package/dist/components/ui/color-picker.client.d.mts +2 -2
- package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
- package/dist/components/ui/combobox.client.d.mts +2 -2
- package/dist/components/ui/command.d.mts +10 -10
- package/dist/components/ui/context-menu.d.mts +16 -16
- package/dist/components/ui/date-picker.client.d.mts +2 -2
- package/dist/components/ui/dialog.client.d.mts +11 -11
- package/dist/components/ui/drawer.client.d.mts +11 -11
- package/dist/components/ui/dropdown-menu.d.mts +16 -16
- package/dist/components/ui/form.client.d.mts +7 -7
- package/dist/components/ui/hover-card.client.d.mts +4 -4
- package/dist/components/ui/input-recipient.d.mts +2 -2
- package/dist/components/ui/input.d.mts +2 -2
- package/dist/components/ui/label.d.mts +2 -2
- package/dist/components/ui/navigation-menu.d.mts +11 -11
- package/dist/components/ui/pagination.d.mts +8 -8
- package/dist/components/ui/popover.d.mts +5 -5
- package/dist/components/ui/progress.client.d.mts +2 -2
- package/dist/components/ui/radio-group.d.mts +3 -3
- package/dist/components/ui/resizable.client.d.mts +4 -4
- package/dist/components/ui/scroll-area.d.mts +3 -3
- package/dist/components/ui/select.client.d.mts +11 -11
- package/dist/components/ui/separator.d.mts +2 -2
- package/dist/components/ui/sheet.client.d.mts +9 -9
- package/dist/components/ui/sidebar.client.d.mts +26 -26
- package/dist/components/ui/skeleton.d.mts +2 -2
- package/dist/components/ui/slider.d.mts +2 -2
- package/dist/components/ui/sonner.client.d.mts +2 -2
- package/dist/components/ui/sonner.client.mjs +1 -1
- package/dist/components/ui/switch.d.mts +2 -2
- package/dist/components/ui/tabs.d.mts +5 -5
- package/dist/components/ui/textarea.d.mts +2 -2
- package/dist/components/ui/time-input.client.d.mts +2 -2
- package/dist/components/ui/toggle-group.client.d.mts +3 -3
- package/dist/components/ui/toggle.d.mts +4 -4
- package/dist/components/ui/toggle.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.d.mts +5 -5
- package/dist/components.mjs +2 -2
- package/dist/lib/client.mjs +1 -1
- package/dist/lib/hooks/use-action.d.mts +2 -2
- package/dist/lib/hooks/use-indicator.d.mts +2 -2
- package/dist/modules/auth/components/allowed.client.d.mts +2 -2
- package/dist/modules/auth/components/allowed.client.mjs +2 -3
- package/dist/modules/auth/components/allowed.client.mjs.map +1 -1
- package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
- package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
- package/dist/modules/auth/components/auth-loading.d.mts +2 -2
- package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
- package/dist/modules/auth/components/create-first-user-page.client.mjs +4 -3
- package/dist/modules/auth/components/create-first-user-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/forget-password-page.client.mjs +4 -3
- package/dist/modules/auth/components/forget-password-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
- package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
- package/dist/modules/auth/components/guard.server.d.mts +3 -2
- package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
- package/dist/modules/auth/components/guard.server.mjs +1 -0
- package/dist/modules/auth/components/guard.server.mjs.map +1 -1
- package/dist/modules/auth/components/login-page.client.d.mts +2 -2
- package/dist/modules/auth/components/login-page.client.mjs +4 -3
- package/dist/modules/auth/components/login-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
- package/dist/modules/auth/components/reset-password-page.client.mjs +4 -3
- package/dist/modules/auth/components/reset-password-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/update-password-command.d.mts +2 -2
- package/dist/modules/auth/components/update-password-command.mjs +1 -1
- package/dist/modules/auth/handler/{client.client.d.mts → create-client.client.d.mts} +288 -168
- package/dist/modules/auth/handler/create-client.client.d.mts.map +1 -0
- package/dist/modules/auth/handler/create-client.client.mjs +26 -0
- package/dist/modules/auth/handler/create-client.client.mjs.map +1 -0
- package/dist/modules/auth/handler/init.d.mts +133 -133
- package/dist/modules/auth/handler/init.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-auth-client.d.mts +24 -0
- package/dist/modules/auth/hooks/use-auth-client.d.mts.map +1 -0
- package/dist/modules/auth/hooks/use-auth-client.mjs +31 -0
- package/dist/modules/auth/hooks/use-auth-client.mjs.map +1 -0
- package/dist/modules/auth/hooks/use-permission.d.mts +8 -35
- package/dist/modules/auth/hooks/use-permission.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-permission.mjs +47 -93
- package/dist/modules/auth/hooks/use-permission.mjs.map +1 -1
- package/dist/modules/auth/hooks/use-session.d.mts +5 -119
- package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
- package/dist/modules/auth/hooks/use-session.mjs +15 -17
- package/dist/modules/auth/hooks/use-session.mjs.map +1 -1
- package/dist/modules/auth/lib/helpers.server.mjs +1 -1
- package/dist/modules/auth/lib/validators.d.mts +2 -2
- package/dist/modules/auth/lib/validators.d.mts.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts +11 -11
- package/dist/modules/commands/components/click-command.client.d.mts +2 -2
- package/dist/modules/commands/components/command-trigger.client.d.mts +4 -4
- package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
- package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
- package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +12 -12
- package/dist/modules/commands/hooks/use-command-menu.client.mjs.map +1 -1
- package/dist/modules/commands/hooks/use-command-mutation.client.mjs +1 -1
- package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
- package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
- package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
- package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
- package/dist/modules/config/db/helpers.d.mts +5 -5
- package/dist/modules/config/db/helpers.d.mts.map +1 -1
- package/dist/modules/config/lib/config.d.mts +1 -1
- package/dist/modules/config/lib/config.mjs.map +1 -1
- package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
- package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
- package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
- package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
- package/dist/modules/data-tables/strategies/helpers/sorting.mjs +1 -1
- package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
- package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/combobox.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/date-input.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/editor.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/input-recipient.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/input-toggle.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/input.client.d.mts +4 -4
- package/dist/modules/inline-edit/components/select.client.d.mts +6 -6
- package/dist/modules/inline-edit/components/switch.client.d.mts +2 -2
- package/dist/modules/inline-edit/components/toggle.client.d.mts +2 -2
- package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
- package/dist/modules/inline-edit/hooks/context.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/hooks/use-inline.client.mjs +2 -6
- package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
- package/dist/modules/storage/components/dropzone.client.d.mts +4 -4
- package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
- package/dist/modules/storage/components/image-grid.client.mjs +1 -1
- package/dist/modules/storage/components/upload-zone.client.d.mts +2 -2
- package/dist/modules/storage/components/upload-zone.client.mjs +1 -2
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
- package/dist/modules/storage/lib/create-upload.client.d.mts.map +1 -1
- package/dist/modules/storage/lib/proxy.server.mjs +1 -1
- package/dist/modules/storage/lib/router.server.d.mts +2354 -2324
- package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
- package/dist/modules/storage/lib/router.server.mjs +2 -3
- package/dist/modules/storage/lib/router.server.mjs.map +1 -1
- package/dist/modules/storage/lib/service.server.d.mts +18 -18
- package/dist/modules/storage/lib/validators.d.mts +90 -90
- package/dist/modules/storage/lib/validators.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/components/layouts/admin-layout.tsx +1 -3
- package/src/components/navigation/admin-sidebar-header.client.tsx +3 -20
- package/src/modules/auth/components/allowed.client.tsx +2 -2
- package/src/modules/auth/components/create-first-user-page.client.tsx +3 -2
- package/src/modules/auth/components/forget-password-page.client.tsx +2 -1
- package/src/modules/auth/components/guard.server.tsx +2 -0
- package/src/modules/auth/components/login-page.client.tsx +2 -1
- package/src/modules/auth/components/reset-password-page.client.tsx +3 -1
- package/src/modules/auth/entry.client.ts +13 -1
- package/src/modules/auth/entry.ts +11 -0
- package/src/modules/auth/handler/create-client.client.ts +53 -0
- package/src/modules/auth/hooks/use-auth-client.tsx +38 -0
- package/src/modules/auth/hooks/use-permission.ts +49 -94
- package/src/modules/auth/hooks/use-session.ts +16 -16
- package/src/modules/commands/hooks/use-command-menu.client.tsx +0 -6
- package/src/modules/config/lib/config.ts +3 -2
- package/src/modules/inline-edit/hooks/use-inline.client.tsx +1 -1
- package/src/modules/storage/components/upload-zone.client.tsx +0 -2
- package/src/modules/storage/lib/router.server.ts +5 -4
- package/dist/modules/auth/handler/client.client.d.mts.map +0 -1
- package/dist/modules/auth/handler/client.client.mjs +0 -21
- package/dist/modules/auth/handler/client.client.mjs.map +0 -1
- package/src/modules/auth/components/guard.client.tsx +0 -12
- package/src/modules/auth/handler/client.client.ts +0 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-page.client.mjs","names":["Form"],"sources":["../../../../src/modules/auth/components/login-page.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport { Button } from \"@/components/ui/button\";\nimport { Form, FormControl, FormField, FormItem, FormMessage } from \"@/components/ui/form.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { standardSchemaResolver } from \"@hookform/resolvers/standard-schema\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { Eye, EyeOff, FingerprintIcon } from \"lucide-react\";\nimport Link from \"next/link\";\nimport { useRouter } from \"next/navigation\";\nimport { parseAsString, useQueryState } from \"nuqs\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport * as z from \"zod\";\nimport {
|
|
1
|
+
{"version":3,"file":"login-page.client.mjs","names":["Form"],"sources":["../../../../src/modules/auth/components/login-page.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport { Button } from \"@/components/ui/button\";\nimport { Form, FormControl, FormField, FormItem, FormMessage } from \"@/components/ui/form.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { standardSchemaResolver } from \"@hookform/resolvers/standard-schema\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { Eye, EyeOff, FingerprintIcon } from \"lucide-react\";\nimport Link from \"next/link\";\nimport { useRouter } from \"next/navigation\";\nimport { parseAsString, useQueryState } from \"nuqs\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport * as z from \"zod\";\nimport { useAuthClient } from \"../hooks/use-auth-client\";\nimport { loginSchema } from \"../lib/validators\";\n\ntype LoginPageProps = {\n options?: {\n enablePasskey?: boolean;\n };\n};\n\nexport function LoginPage(props: LoginPageProps) {\n const router = useRouter();\n const authClient = useAuthClient();\n const [callbackURL] = useQueryState(\"callbackURL\", parseAsString);\n const [showPassword, setShowPassword] = useState(false);\n\n const loginWithEmailMutation = useMutation({\n mutationFn: async (data: z.infer<typeof loginSchema>) => {\n const result = await authClient.signIn.email({\n ...data,\n callbackURL: callbackURL ?? \"/admin\",\n });\n if (result.error) throw result.error;\n\n return result.data;\n },\n onError: (err) => {\n console.error(\"Login error: \", err);\n\n if (\"status\" in err) {\n if (err.status === 401) {\n toast.error(\"Ongeldige email of wachtwoord\");\n return;\n }\n\n if (err.status === 403) {\n toast.error(\"Account is geblokkeerd\");\n return;\n }\n\n if (err.status === 429) {\n toast.error(\"Te veel login pogingen\");\n return;\n }\n }\n\n toast.error(\"Er is iets misgegaan\");\n },\n });\n\n const loginWithPasskeyMutation = useMutation({\n mutationFn: async () => {\n const result = await authClient.signIn.passkey();\n if (result.error) throw result.error;\n\n return result.data;\n },\n onSuccess: () => {\n router.replace(callbackURL ?? \"/admin\");\n toast.success(\"Succesvol ingelogd\");\n },\n onError: (err) => {\n console.error(\"Login error: \", err);\n toast.error(\"Er is iets misgegaan\");\n },\n });\n\n const disabled = loginWithEmailMutation.isPending || loginWithPasskeyMutation.isPending;\n\n const form = useForm<z.infer<typeof loginSchema>>({\n resolver: standardSchemaResolver(loginSchema),\n defaultValues: { email: \"\", password: \"\" },\n disabled,\n });\n\n return (\n <div className=\"mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]\">\n <div className=\"flex flex-col space-y-2 text-center\">\n <h1 className=\"text-3xl font-semibold tracking-tight\">Login</h1>\n <p className=\"text-muted-foreground text-sm\">\n Schrijf je email en wachtwoord in om in te loggen.\n </p>\n </div>\n\n <Form {...form}>\n <form\n className=\"space-y-6\"\n onSubmit={form.handleSubmit((data) => loginWithEmailMutation.mutate(data))}\n >\n <div className=\"flex flex-col gap-3\">\n <FormField\n control={form.control}\n name=\"email\"\n render={({ field }) => (\n <FormItem>\n <FormControl>\n <Input placeholder=\"email@example.be\" {...field} />\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n <FormField\n control={form.control}\n name=\"password\"\n render={({ field }) => (\n <FormItem>\n <FormControl>\n <div className=\"relative\">\n <Input\n type={showPassword ? \"text\" : \"password\"}\n placeholder=\"********\"\n {...field}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent\"\n onClick={() => setShowPassword(!showPassword)}\n disabled={disabled}\n >\n {showPassword ? (\n <EyeOff className=\"text-muted-foreground h-4 w-4\" />\n ) : (\n <Eye className=\"text-muted-foreground h-4 w-4\" />\n )}\n </Button>\n </div>\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n </div>\n\n <div className=\"space-y-3\">\n <Button disabled={disabled} className=\"w-full\">\n {loginWithEmailMutation.isPending && (\n <Icons.spinner className=\"mr-2 h-4 w-4 animate-spin\" />\n )}\n Inloggen\n </Button>\n\n {props.options?.enablePasskey && (\n <Button\n className=\"w-full\"\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n onClick={() => loginWithPasskeyMutation.mutate()}\n >\n {loginWithPasskeyMutation.isPending ? (\n <Icons.spinner className=\"mr-2 h-4 w-4 animate-spin\" />\n ) : (\n <FingerprintIcon className=\"mr-2 h-4 w-4\" />\n )}\n Inloggen met passkey\n </Button>\n )}\n </div>\n </form>\n </Form>\n\n <p className=\"text-muted-foreground px-8 text-center text-sm\">\n <Link\n href=\"/auth/forget-password\"\n className=\"hover:text-primary underline underline-offset-4\"\n >\n Wachtwoord vergeten\n </Link>\n </p>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,UAAU,OAAuB;CAC/C,MAAM,SAAS,WAAW;CAC1B,MAAM,aAAa,eAAe;CAClC,MAAM,CAAC,eAAe,cAAc,eAAe,cAAc;CACjE,MAAM,CAAC,cAAc,mBAAmB,SAAS,MAAM;CAEvD,MAAM,yBAAyB,YAAY;EACzC,YAAY,OAAO,SAAsC;GACvD,MAAM,SAAS,MAAM,WAAW,OAAO,MAAM;IAC3C,GAAG;IACH,aAAa,eAAe;IAC7B,CAAC;AACF,OAAI,OAAO,MAAO,OAAM,OAAO;AAE/B,UAAO,OAAO;;EAEhB,UAAU,QAAQ;AAChB,WAAQ,MAAM,iBAAiB,IAAI;AAEnC,OAAI,YAAY,KAAK;AACnB,QAAI,IAAI,WAAW,KAAK;AACtB,WAAM,MAAM,gCAAgC;AAC5C;;AAGF,QAAI,IAAI,WAAW,KAAK;AACtB,WAAM,MAAM,yBAAyB;AACrC;;AAGF,QAAI,IAAI,WAAW,KAAK;AACtB,WAAM,MAAM,yBAAyB;AACrC;;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AAO,WAAU,kCAAkC,GAEpD,oBAAC,OAAI,WAAU,kCAAkC;UAE5C;SACL,GACM,EACd,oBAAC,gBAAc,IACN;QAEb;OACE,EAEN,qBAAC;MAAI,WAAU;iBACb,qBAAC;OAAiB;OAAU,WAAU;kBACnC,uBAAuB,aACtB,oBAAC,MAAM,WAAQ,WAAU,8BAA8B,EACvD;QAEK,EAER,MAAM,SAAS,iBACd,qBAAC;OACC,WAAU;OACV,MAAK;OACL,SAAQ;OACE;OACV,eAAe,yBAAyB,QAAQ;kBAE/C,yBAAyB,YACxB,oBAAC,MAAM,WAAQ,WAAU,8BAA8B,GAEvD,oBAAC,mBAAgB,WAAU,iBAAiB,EAC5C;QAEK;OAEP;MACD;KACF;GAEP,oBAAC;IAAE,WAAU;cACX,oBAAC;KACC,MAAK;KACL,WAAU;eACX;MAEM;KACL;;GACA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime64 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/modules/auth/components/reset-password-page.client.d.ts
|
|
4
4
|
declare function ResetPasswordPage(params: {
|
|
@@ -6,7 +6,7 @@ declare function ResetPasswordPage(params: {
|
|
|
6
6
|
email: string;
|
|
7
7
|
otp: string;
|
|
8
8
|
}>;
|
|
9
|
-
}):
|
|
9
|
+
}): react_jsx_runtime64.JSX.Element;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { ResetPasswordPage };
|
|
12
12
|
//# sourceMappingURL=reset-password-page.client.d.mts.map
|
|
@@ -2,22 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
import { Icons } from "../../../components/common/icons.mjs";
|
|
4
4
|
import { Button } from "../../../components/ui/button.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { Form as Form$1, FormControl, FormField, FormItem, FormLabel, FormMessage } from "../../../components/ui/form.client.mjs";
|
|
5
|
+
import { useAuthClient } from "../hooks/use-auth-client.mjs";
|
|
7
6
|
import { Input } from "../../../components/ui/input.mjs";
|
|
7
|
+
import { Form as Form$1, FormControl, FormField, FormItem, FormLabel, FormMessage } from "../../../components/ui/form.client.mjs";
|
|
8
8
|
import { resetPasswordSchema } from "../lib/validators.mjs";
|
|
9
9
|
import { Eye, EyeOff } from "lucide-react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import React, { use, useState } from "react";
|
|
12
12
|
import { useRouter } from "next/navigation";
|
|
13
|
-
import { useForm } from "react-hook-form";
|
|
14
13
|
import { toast } from "sonner";
|
|
14
|
+
import { useForm } from "react-hook-form";
|
|
15
15
|
import { standardSchemaResolver } from "@hookform/resolvers/standard-schema";
|
|
16
16
|
|
|
17
17
|
//#region src/modules/auth/components/reset-password-page.client.tsx
|
|
18
18
|
function ResetPasswordPage(params) {
|
|
19
19
|
const { email, otp } = use(params.searchParams);
|
|
20
20
|
const router = useRouter();
|
|
21
|
+
const authClient = useAuthClient();
|
|
21
22
|
const [showPassword, setShowPassword] = useState(false);
|
|
22
23
|
const [showPasswordConfirm, setShowPasswordConfirm] = useState(false);
|
|
23
24
|
const [isPending, startTransition$1] = React.useTransition();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-password-page.client.mjs","names":["startTransition","Form"],"sources":["../../../../src/modules/auth/components/reset-password-page.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from \"@/components/ui/form.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { standardSchemaResolver } from \"@hookform/resolvers/standard-schema\";\nimport { Eye, EyeOff } from \"lucide-react\";\nimport { useRouter } from \"next/navigation\";\nimport React, { use, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport * as z from \"zod\";\nimport {
|
|
1
|
+
{"version":3,"file":"reset-password-page.client.mjs","names":["startTransition","Form"],"sources":["../../../../src/modules/auth/components/reset-password-page.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Icons } from \"@/components/common/icons\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Form,\n FormControl,\n FormField,\n FormItem,\n FormLabel,\n FormMessage,\n} from \"@/components/ui/form.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { standardSchemaResolver } from \"@hookform/resolvers/standard-schema\";\nimport { Eye, EyeOff } from \"lucide-react\";\nimport { useRouter } from \"next/navigation\";\nimport React, { use, useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport * as z from \"zod\";\nimport { useAuthClient } from \"../hooks/use-auth-client\";\nimport { resetPasswordSchema } from \"../lib/validators\";\n\nexport function ResetPasswordPage(params: {\n searchParams: Promise<{ email: string; otp: string }>;\n}) {\n const { email, otp } = use(params.searchParams);\n\n const router = useRouter();\n const authClient = useAuthClient();\n\n const [showPassword, setShowPassword] = useState(false);\n const [showPasswordConfirm, setShowPasswordConfirm] = useState(false);\n\n const [isPending, startTransition] = React.useTransition();\n\n const form = useForm<z.infer<typeof resetPasswordSchema>>({\n resolver: standardSchemaResolver(resetPasswordSchema),\n disabled: isPending,\n });\n\n return (\n <div className=\"mx-auto flex w-full flex-col justify-center space-y-6 sm:w-[350px]\">\n <div className=\"flex flex-col space-y-2 text-center\">\n <h1 className=\"text-3xl font-semibold tracking-tight\">Wachtwoord herstellen</h1>\n <p className=\"text-muted-foreground text-sm\">Vul je nieuwe wachtwoord in</p>\n </div>\n\n <Form {...form}>\n <form\n onSubmit={form.handleSubmit(({ password }) =>\n startTransition(async () => {\n await authClient.emailOtp.resetPassword({\n email,\n otp,\n password,\n fetchOptions: {\n onSuccess: () => {\n toast.success(\"Wachtwoord succesvol gewijzigd\", {\n description: \"Log nu in met je nieuw wachtwoord.\",\n });\n router.replace(\"/auth/login\");\n },\n onError: ({ error }) => {\n console.error(\"Error: \", error);\n toast.error(\"Er is iets misgegaan\");\n },\n },\n });\n }),\n )}\n className=\"space-y-6\"\n >\n <div className=\"flex flex-col gap-3\">\n <FormField\n control={form.control}\n name=\"password\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Wachtwoord</FormLabel>\n <FormControl>\n <div className=\"relative\">\n <Input\n type={showPassword ? \"text\" : \"password\"}\n placeholder=\"********\"\n {...field}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent\"\n onClick={() => setShowPassword(!showPassword)}\n disabled={form.formState.disabled}\n >\n {showPassword ? (\n <EyeOff className=\"text-muted-foreground h-4 w-4\" />\n ) : (\n <Eye className=\"text-muted-foreground h-4 w-4\" />\n )}\n </Button>\n </div>\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n\n <FormField\n control={form.control}\n name=\"passwordConfirmation\"\n render={({ field }) => (\n <FormItem>\n <FormLabel>Herhaal Wachtwoord</FormLabel>\n <FormControl>\n <div className=\"relative\">\n <Input\n type={showPasswordConfirm ? \"text\" : \"password\"}\n placeholder=\"********\"\n {...field}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"absolute right-0 top-0 h-full px-3 py-2 hover:bg-transparent\"\n onClick={() => setShowPasswordConfirm(!showPasswordConfirm)}\n disabled={form.formState.disabled}\n >\n {showPasswordConfirm ? (\n <EyeOff className=\"text-muted-foreground h-4 w-4\" />\n ) : (\n <Eye className=\"text-muted-foreground h-4 w-4\" />\n )}\n </Button>\n </div>\n </FormControl>\n <FormMessage />\n </FormItem>\n )}\n />\n </div>\n\n <Button disabled={form.formState.disabled} className=\"w-full\">\n {isPending && <Icons.spinner className=\"mr-2 h-4 w-4 animate-spin\" />}\n Verzenden\n </Button>\n </form>\n </Form>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,SAAgB,kBAAkB,QAE/B;CACD,MAAM,EAAE,OAAO,QAAQ,IAAI,OAAO,aAA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EAEF,oBAAC;MACC,SAAS,KAAK;MACd,MAAK;MACL,SAAS,EAAE,YACT,qBAAC;OACC,oBAAC,uBAAU,uBAA8B;OACzC,oBAAC,yBACC,qBAAC;QAAI,WAAU;mBACb,oBAAC;SACC,MAAM,sBAAsB,SAAS;SACrC,aAAY;SACZ,GAAI;UACJ,EACF,oBAAC;SACC,MAAK;SACL,SAAQ;SACR,MAAK;SACL,WAAU;SACV,eAAe,uBAAuB,CAAC,oBAAoB;SAC3D,UAAU,KAAK,UAAU;mBAExB,sBACC,oBAAC,UAAO,WAAU,kCAAkC,GAEpD,oBAAC,OAAI,WAAU,kCAAkC;UAE5C;SACL,GACM;OACd,oBAAC,gBAAc;UACN;OAEb;MACE,EAEN,qBAAC;KAAO,UAAU,KAAK,UAAU;KAAU,WAAU;gBAClD,aAAa,oBAAC,MAAM,WAAQ,WAAU,8BAA8B,EAAC;MAE/D;KACJ;IACF;GACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UpdatePasswordSchema } from "../lib/validators.mjs";
|
|
2
2
|
import { CommandFormDialogTrigger } from "../../commands/components/form-dialog-command.client.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime65 from "react/jsx-runtime";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { DefaultError, MutationOptions } from "@tanstack/react-query";
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ declare function UpdatePasswordCommand<TData = unknown, TError = DefaultError, T
|
|
|
16
16
|
mutation,
|
|
17
17
|
defaultValues,
|
|
18
18
|
children
|
|
19
|
-
}: UpdatePasswordCommandProps<TData, TError, TVariables, TOnMutateResult>):
|
|
19
|
+
}: UpdatePasswordCommandProps<TData, TError, TVariables, TOnMutateResult>): react_jsx_runtime65.JSX.Element;
|
|
20
20
|
declare const UpdatePasswordCommandTrigger: typeof CommandFormDialogTrigger;
|
|
21
21
|
//#endregion
|
|
22
22
|
export { UpdatePasswordCommand, UpdatePasswordCommandProps, UpdatePasswordCommandTrigger };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { Form as Form$1, FormControl, FormField, FormItem, FormLabel, FormMessage } from "../../../components/ui/form.client.mjs";
|
|
4
3
|
import { Input } from "../../../components/ui/input.mjs";
|
|
4
|
+
import { Form as Form$1, FormControl, FormField, FormItem, FormLabel, FormMessage } from "../../../components/ui/form.client.mjs";
|
|
5
5
|
import { updatePasswordSchema } from "../lib/validators.mjs";
|
|
6
6
|
import { CommandFormDialog, CommandFormDialogCancel, CommandFormDialogContent, CommandFormDialogFooter, CommandFormDialogHeader, CommandFormDialogSubmit, CommandFormDialogTitle, CommandFormDialogTrigger } from "../../commands/components/form-dialog-command.client.mjs";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|