kaze 0.5.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kaze/commands/install_command.rb +18 -4
  3. data/lib/kaze/commands/installs_hotwire_stack.rb +5 -2
  4. data/lib/kaze/commands/installs_inertia_stacks.rb +13 -3
  5. data/lib/kaze/version.rb +1 -1
  6. data/stubs/default/app/forms/auth/login_form.rb +2 -8
  7. data/stubs/default/app/forms/update_profile_information_form.rb +1 -1
  8. data/stubs/default/app/models/auth.rb +57 -0
  9. data/stubs/default/app/models/current.rb +1 -1
  10. data/stubs/default/app/validators/current_password_validator.rb +1 -1
  11. data/stubs/default/app/views/layouts/mailer.html.erb +367 -372
  12. data/stubs/default/app/views/layouts/mailer.text.erb +1 -4
  13. data/stubs/default/app/views/user_mailer/reset_password.html.erb +21 -26
  14. data/stubs/default/test/factories/users.rb +7 -0
  15. data/stubs/default/test/integration/auth/authentication_test.rb +43 -0
  16. data/stubs/default/test/integration/auth/password_reset_test.rb +41 -0
  17. data/stubs/default/test/integration/auth/registration_test.rb +21 -0
  18. data/stubs/default/test/integration/password_update_test.rb +28 -0
  19. data/stubs/default/test/integration/profile_test.rb +51 -0
  20. data/stubs/default/test/test_helper.rb +38 -0
  21. data/stubs/hotwire/app/components/dropdown_component.html.erb +17 -18
  22. data/stubs/hotwire/app/components/modal_component.html.erb +55 -59
  23. data/stubs/hotwire/app/controllers/application_controller.rb +1 -0
  24. data/stubs/hotwire/app/controllers/auth/authenticated_session_controller.rb +10 -7
  25. data/stubs/hotwire/app/controllers/auth/new_password_controller.rb +3 -1
  26. data/stubs/hotwire/app/controllers/auth/password_reset_link_controller.rb +3 -1
  27. data/stubs/hotwire/app/controllers/auth/registered_user_controller.rb +4 -2
  28. data/stubs/hotwire/app/controllers/concerns/authenticate.rb +5 -20
  29. data/stubs/hotwire/app/controllers/concerns/redirect_if_authenticated.rb +19 -0
  30. data/stubs/hotwire/app/controllers/concerns/set_current_auth.rb +9 -0
  31. data/stubs/hotwire/app/controllers/password_controller.rb +1 -1
  32. data/stubs/hotwire/app/controllers/profile_controller.rb +6 -4
  33. data/stubs/hotwire/app/controllers/welcome_controller.rb +1 -1
  34. data/stubs/hotwire/app/javascript/application.js +3 -3
  35. data/stubs/hotwire/app/views/auth/forgot_password.html.erb +12 -17
  36. data/stubs/hotwire/app/views/auth/login.html.erb +0 -9
  37. data/stubs/hotwire/app/views/auth/register.html.erb +0 -13
  38. data/stubs/hotwire/app/views/auth/reset_password.html.erb +0 -7
  39. data/stubs/hotwire/app/views/dashboard/index.html.erb +9 -10
  40. data/stubs/hotwire/app/views/layouts/_navigation.html.erb +77 -87
  41. data/stubs/hotwire/app/views/layouts/application.html.erb +0 -9
  42. data/stubs/hotwire/app/views/layouts/guest.html.erb +0 -6
  43. data/stubs/hotwire/app/views/profile/edit.html.erb +19 -22
  44. data/stubs/hotwire/app/views/profile/partials/_delete_user_form.html.erb +32 -42
  45. data/stubs/hotwire/app/views/profile/partials/_update_password_form.html.erb +42 -55
  46. data/stubs/hotwire/app/views/profile/partials/_update_profile_information_form.html.erb +36 -46
  47. data/stubs/hotwire/app/views/welcome/index.html.erb +34 -46
  48. data/stubs/hotwire/config/tailwind.config.js +2 -2
  49. data/stubs/inertia-common/app/controllers/application_controller.rb +1 -0
  50. data/stubs/inertia-common/app/controllers/auth/authenticated_session_controller.rb +10 -7
  51. data/stubs/inertia-common/app/controllers/auth/new_password_controller.rb +3 -1
  52. data/stubs/inertia-common/app/controllers/auth/password_reset_link_controller.rb +3 -1
  53. data/stubs/inertia-common/app/controllers/auth/registered_user_controller.rb +4 -2
  54. data/stubs/inertia-common/app/controllers/concerns/authenticate.rb +5 -20
  55. data/stubs/inertia-common/app/controllers/concerns/handle_inertia_requests.rb +1 -1
  56. data/stubs/inertia-common/app/controllers/concerns/redirect_if_authenticated.rb +19 -0
  57. data/stubs/inertia-common/app/controllers/concerns/set_current_auth.rb +9 -0
  58. data/stubs/inertia-common/app/controllers/password_controller.rb +1 -1
  59. data/stubs/inertia-common/app/controllers/profile_controller.rb +5 -3
  60. data/stubs/inertia-common/app/controllers/welcome_controller.rb +1 -1
  61. data/stubs/inertia-common/test/integration/password_update_test.rb +28 -0
  62. data/stubs/inertia-common/test/integration/profile_test.rb +51 -0
  63. data/stubs/inertia-react-ts/app/javascript/Components/ApplicationLogo.tsx +13 -9
  64. data/stubs/inertia-react-ts/app/javascript/Components/Checkbox.tsx +12 -12
  65. data/stubs/inertia-react-ts/app/javascript/Components/DangerButton.tsx +20 -15
  66. data/stubs/inertia-react-ts/app/javascript/Components/Dropdown.tsx +115 -88
  67. data/stubs/inertia-react-ts/app/javascript/Components/InputError.tsx +14 -7
  68. data/stubs/inertia-react-ts/app/javascript/Components/InputLabel.tsx +15 -7
  69. data/stubs/inertia-react-ts/app/javascript/Components/Modal.tsx +60 -60
  70. data/stubs/inertia-react-ts/app/javascript/Components/NavLink.tsx +21 -16
  71. data/stubs/inertia-react-ts/app/javascript/Components/PrimaryButton.tsx +20 -15
  72. data/stubs/inertia-react-ts/app/javascript/Components/ResponsiveNavLink.tsx +19 -14
  73. data/stubs/inertia-react-ts/app/javascript/Components/SecondaryButton.tsx +22 -16
  74. data/stubs/inertia-react-ts/app/javascript/Components/TextInput.tsx +32 -24
  75. data/stubs/inertia-react-ts/app/javascript/Layouts/AuthenticatedLayout.tsx +157 -117
  76. data/stubs/inertia-react-ts/app/javascript/Layouts/GuestLayout.tsx +15 -15
  77. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ForgotPassword.tsx +52 -49
  78. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/Login.tsx +90 -82
  79. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/Register.tsx +118 -115
  80. data/stubs/inertia-react-ts/app/javascript/Pages/Auth/ResetPassword.tsx +63 -60
  81. data/stubs/inertia-react-ts/app/javascript/Pages/Dashboard.tsx +23 -17
  82. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Edit.tsx +31 -27
  83. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/DeleteUserForm.tsx +109 -99
  84. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/UpdatePasswordForm.tsx +121 -113
  85. data/stubs/inertia-react-ts/app/javascript/Pages/Profile/Partials/UpdateProfileInformationForm.tsx +76 -69
  86. data/stubs/inertia-react-ts/app/javascript/Pages/Welcome.tsx +87 -63
  87. data/stubs/inertia-react-ts/app/javascript/entrypoints/application.tsx +32 -25
  88. data/stubs/inertia-react-ts/app/views/layouts/application.html.erb +0 -4
  89. data/stubs/inertia-react-ts/config/tailwind.config.js +2 -2
  90. data/stubs/inertia-react-ts/vite.config.ts +2 -5
  91. data/stubs/inertia-vue-ts/app/javascript/Components/ApplicationLogo.vue +10 -6
  92. data/stubs/inertia-vue-ts/app/javascript/Components/Checkbox.vue +18 -18
  93. data/stubs/inertia-vue-ts/app/javascript/Components/DangerButton.vue +5 -5
  94. data/stubs/inertia-vue-ts/app/javascript/Components/Dropdown.vue +60 -57
  95. data/stubs/inertia-vue-ts/app/javascript/Components/DropdownLink.vue +9 -9
  96. data/stubs/inertia-vue-ts/app/javascript/Components/InputError.vue +7 -7
  97. data/stubs/inertia-vue-ts/app/javascript/Components/InputLabel.vue +6 -6
  98. data/stubs/inertia-vue-ts/app/javascript/Components/Modal.vue +84 -74
  99. data/stubs/inertia-vue-ts/app/javascript/Components/NavLink.vue +12 -12
  100. data/stubs/inertia-vue-ts/app/javascript/Components/PrimaryButton.vue +5 -5
  101. data/stubs/inertia-vue-ts/app/javascript/Components/ResponsiveNavLink.vue +12 -12
  102. data/stubs/inertia-vue-ts/app/javascript/Components/SecondaryButton.vue +13 -13
  103. data/stubs/inertia-vue-ts/app/javascript/Components/TextInput.vue +13 -13
  104. data/stubs/inertia-vue-ts/app/javascript/Layouts/AuthenticatedLayout.vue +168 -136
  105. data/stubs/inertia-vue-ts/app/javascript/Layouts/GuestLayout.vue +15 -13
  106. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ForgotPassword.vue +56 -49
  107. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/Login.vue +78 -72
  108. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/Register.vue +101 -97
  109. data/stubs/inertia-vue-ts/app/javascript/Pages/Auth/ResetPassword.vue +71 -68
  110. data/stubs/inertia-vue-ts/app/javascript/Pages/Dashboard.vue +22 -14
  111. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Edit.vue +34 -30
  112. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/DeleteUserForm.vue +87 -83
  113. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/UpdatePasswordForm.vue +105 -98
  114. data/stubs/inertia-vue-ts/app/javascript/Pages/Profile/Partials/UpdateProfileInformationForm.vue +69 -59
  115. data/stubs/inertia-vue-ts/app/javascript/Pages/Welcome.vue +74 -47
  116. data/stubs/inertia-vue-ts/app/views/layouts/application.html.erb +0 -4
  117. data/stubs/inertia-vue-ts/config/tailwind.config.js +2 -2
  118. data/stubs/inertia-vue-ts/vite.config.ts +2 -5
  119. metadata +18 -6
  120. data/stubs/hotwire/bin/vite +0 -27
  121. data/stubs/inertia-common/Procfile.dev +0 -3
  122. /data/stubs/{hotwire → default}/Procfile.dev +0 -0
  123. /data/stubs/hotwire/app/javascript/{alpinejs.js → alpinejs.stub} +0 -0
@@ -1,93 +1,99 @@
1
1
  <script setup lang="ts">
2
- import Checkbox from '@/Components/Checkbox.vue';
3
- import GuestLayout from '@/Layouts/GuestLayout.vue';
4
- import InputError from '@/Components/InputError.vue';
5
- import InputLabel from '@/Components/InputLabel.vue';
6
- import PrimaryButton from '@/Components/PrimaryButton.vue';
7
- import TextInput from '@/Components/TextInput.vue';
8
- import { Head, Link, useForm } from '@inertiajs/vue3';
9
- import { login_path, password_request_path } from '@/routes';
2
+ import Checkbox from '@/Components/Checkbox.vue'
3
+ import GuestLayout from '@/Layouts/GuestLayout.vue'
4
+ import InputError from '@/Components/InputError.vue'
5
+ import InputLabel from '@/Components/InputLabel.vue'
6
+ import PrimaryButton from '@/Components/PrimaryButton.vue'
7
+ import TextInput from '@/Components/TextInput.vue'
8
+ import { Head, Link, useForm } from '@inertiajs/vue3'
9
+ import { login_path, password_request_path } from '@/routes'
10
10
 
11
11
  defineProps<{
12
- canResetPassword?: boolean;
13
- status?: string;
14
- }>();
12
+ canResetPassword?: boolean
13
+ status?: string
14
+ }>()
15
15
 
16
16
  const form = useForm({
17
- email: '',
18
- password: '',
19
- remember: false,
20
- });
17
+ email: '',
18
+ password: '',
19
+ remember: false,
20
+ })
21
21
 
22
22
  const submit = () => {
23
- form.post(login_path(), {
24
- onFinish: () => {
25
- form.reset('password');
26
- },
27
- });
28
- };
23
+ form.post(login_path(), {
24
+ onFinish: () => {
25
+ form.reset('password')
26
+ },
27
+ })
28
+ }
29
29
  </script>
30
30
 
31
31
  <template>
32
- <GuestLayout>
33
- <Head title="Log in" />
32
+ <GuestLayout>
33
+ <Head title="Log in" />
34
34
 
35
- <div v-if="status" class="mb-4 font-medium text-sm text-green-600">
36
- {{ status }}
37
- </div>
35
+ <div v-if="status" class="mb-4 font-medium text-sm text-green-600">
36
+ {{ status }}
37
+ </div>
38
38
 
39
- <form @submit.prevent="submit">
40
- <div>
41
- <InputLabel for="email" value="Email" />
39
+ <form @submit.prevent="submit">
40
+ <div>
41
+ <InputLabel for="email" value="Email" />
42
42
 
43
- <TextInput
44
- id="email"
45
- type="email"
46
- class="mt-1 block w-full"
47
- v-model="form.email"
48
- required
49
- autofocus
50
- autocomplete="username"
51
- />
43
+ <TextInput
44
+ id="email"
45
+ type="email"
46
+ class="mt-1 block w-full"
47
+ v-model="form.email"
48
+ required
49
+ autofocus
50
+ autocomplete="username"
51
+ />
52
52
 
53
- <InputError class="mt-2" :message="form.errors.email" />
54
- </div>
53
+ <InputError class="mt-2" :message="form.errors.email" />
54
+ </div>
55
55
 
56
- <div class="mt-4">
57
- <InputLabel for="password" value="Password" />
56
+ <div class="mt-4">
57
+ <InputLabel for="password" value="Password" />
58
58
 
59
- <TextInput
60
- id="password"
61
- type="password"
62
- class="mt-1 block w-full"
63
- v-model="form.password"
64
- required
65
- autocomplete="current-password"
66
- />
59
+ <TextInput
60
+ id="password"
61
+ type="password"
62
+ class="mt-1 block w-full"
63
+ v-model="form.password"
64
+ required
65
+ autocomplete="current-password"
66
+ />
67
67
 
68
- <InputError class="mt-2" :message="form.errors.password" />
69
- </div>
68
+ <InputError class="mt-2" :message="form.errors.password" />
69
+ </div>
70
70
 
71
- <div class="block mt-4">
72
- <label class="flex items-center">
73
- <Checkbox name="remember" v-model:checked="form.remember" />
74
- <span class="ms-2 text-sm text-gray-600 dark:text-gray-400">Remember me</span>
75
- </label>
76
- </div>
71
+ <div class="block mt-4">
72
+ <label class="flex items-center">
73
+ <Checkbox name="remember" v-model:checked="form.remember" />
74
+ <span class="ms-2 text-sm text-gray-600 dark:text-gray-400"
75
+ >Remember me</span
76
+ >
77
+ </label>
78
+ </div>
77
79
 
78
- <div class="flex items-center justify-end mt-4">
79
- <Link
80
- v-if="canResetPassword"
81
- :href="password_request_path()"
82
- class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
83
- >
84
- Forgot your password?
85
- </Link>
80
+ <div class="flex items-center justify-end mt-4">
81
+ <Link
82
+ v-if="canResetPassword"
83
+ :href="password_request_path()"
84
+ class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
85
+ >
86
+ Forgot your password?
87
+ </Link>
86
88
 
87
- <PrimaryButton class="ms-4" :class="{ 'opacity-25': form.processing }" :disabled="form.processing">
88
- Log in
89
- </PrimaryButton>
90
- </div>
91
- </form>
92
- </GuestLayout>
89
+ <PrimaryButton
90
+ class="ms-4"
91
+ :class="{ 'opacity-25': form.processing }"
92
+ :disabled="form.processing"
93
+ >
94
+ Log in
95
+ </PrimaryButton>
96
+ </div>
97
+ </form>
98
+ </GuestLayout>
93
99
  </template>
@@ -1,106 +1,110 @@
1
1
  <script setup lang="ts">
2
- import GuestLayout from '@/Layouts/GuestLayout.vue';
3
- import InputError from '@/Components/InputError.vue';
4
- import InputLabel from '@/Components/InputLabel.vue';
5
- import PrimaryButton from '@/Components/PrimaryButton.vue';
6
- import TextInput from '@/Components/TextInput.vue';
7
- import { Head, Link, useForm } from '@inertiajs/vue3';
8
- import { login_path, register_path } from '@/routes';
2
+ import GuestLayout from '@/Layouts/GuestLayout.vue'
3
+ import InputError from '@/Components/InputError.vue'
4
+ import InputLabel from '@/Components/InputLabel.vue'
5
+ import PrimaryButton from '@/Components/PrimaryButton.vue'
6
+ import TextInput from '@/Components/TextInput.vue'
7
+ import { Head, Link, useForm } from '@inertiajs/vue3'
8
+ import { login_path, register_path } from '@/routes'
9
9
 
10
10
  const form = useForm({
11
- name: '',
12
- email: '',
13
- password: '',
14
- password_confirmation: '',
15
- });
11
+ name: '',
12
+ email: '',
13
+ password: '',
14
+ password_confirmation: '',
15
+ })
16
16
 
17
17
  const submit = () => {
18
- form.post(register_path(), {
19
- onFinish: () => {
20
- form.reset('password', 'password_confirmation');
21
- },
22
- });
23
- };
18
+ form.post(register_path(), {
19
+ onFinish: () => {
20
+ form.reset('password', 'password_confirmation')
21
+ },
22
+ })
23
+ }
24
24
  </script>
25
25
 
26
26
  <template>
27
- <GuestLayout>
28
- <Head title="Register" />
29
-
30
- <form @submit.prevent="submit">
31
- <div>
32
- <InputLabel for="name" value="Name" />
33
-
34
- <TextInput
35
- id="name"
36
- type="text"
37
- class="mt-1 block w-full"
38
- v-model="form.name"
39
- required
40
- autofocus
41
- autocomplete="name"
42
- />
43
-
44
- <InputError class="mt-2" :message="form.errors.name" />
45
- </div>
46
-
47
- <div class="mt-4">
48
- <InputLabel for="email" value="Email" />
49
-
50
- <TextInput
51
- id="email"
52
- type="email"
53
- class="mt-1 block w-full"
54
- v-model="form.email"
55
- required
56
- autocomplete="username"
57
- />
58
-
59
- <InputError class="mt-2" :message="form.errors.email" />
60
- </div>
61
-
62
- <div class="mt-4">
63
- <InputLabel for="password" value="Password" />
64
-
65
- <TextInput
66
- id="password"
67
- type="password"
68
- class="mt-1 block w-full"
69
- v-model="form.password"
70
- required
71
- autocomplete="new-password"
72
- />
73
-
74
- <InputError class="mt-2" :message="form.errors.password" />
75
- </div>
76
-
77
- <div class="mt-4">
78
- <InputLabel for="password_confirmation" value="Confirm Password" />
79
-
80
- <TextInput
81
- id="password_confirmation"
82
- type="password"
83
- class="mt-1 block w-full"
84
- v-model="form.password_confirmation"
85
- required
86
- autocomplete="new-password"
87
- />
88
-
89
- <InputError class="mt-2" :message="form.errors.password_confirmation" />
90
- </div>
91
-
92
- <div class="flex items-center justify-end mt-4">
93
- <Link
94
- :href="login_path()"
95
- class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
96
- >
97
- Already registered?
98
- </Link>
99
-
100
- <PrimaryButton class="ms-4" :class="{ 'opacity-25': form.processing }" :disabled="form.processing">
101
- Register
102
- </PrimaryButton>
103
- </div>
104
- </form>
105
- </GuestLayout>
27
+ <GuestLayout>
28
+ <Head title="Register" />
29
+
30
+ <form @submit.prevent="submit">
31
+ <div>
32
+ <InputLabel for="name" value="Name" />
33
+
34
+ <TextInput
35
+ id="name"
36
+ type="text"
37
+ class="mt-1 block w-full"
38
+ v-model="form.name"
39
+ required
40
+ autofocus
41
+ autocomplete="name"
42
+ />
43
+
44
+ <InputError class="mt-2" :message="form.errors.name" />
45
+ </div>
46
+
47
+ <div class="mt-4">
48
+ <InputLabel for="email" value="Email" />
49
+
50
+ <TextInput
51
+ id="email"
52
+ type="email"
53
+ class="mt-1 block w-full"
54
+ v-model="form.email"
55
+ required
56
+ autocomplete="username"
57
+ />
58
+
59
+ <InputError class="mt-2" :message="form.errors.email" />
60
+ </div>
61
+
62
+ <div class="mt-4">
63
+ <InputLabel for="password" value="Password" />
64
+
65
+ <TextInput
66
+ id="password"
67
+ type="password"
68
+ class="mt-1 block w-full"
69
+ v-model="form.password"
70
+ required
71
+ autocomplete="new-password"
72
+ />
73
+
74
+ <InputError class="mt-2" :message="form.errors.password" />
75
+ </div>
76
+
77
+ <div class="mt-4">
78
+ <InputLabel for="password_confirmation" value="Confirm Password" />
79
+
80
+ <TextInput
81
+ id="password_confirmation"
82
+ type="password"
83
+ class="mt-1 block w-full"
84
+ v-model="form.password_confirmation"
85
+ required
86
+ autocomplete="new-password"
87
+ />
88
+
89
+ <InputError class="mt-2" :message="form.errors.password_confirmation" />
90
+ </div>
91
+
92
+ <div class="flex items-center justify-end mt-4">
93
+ <Link
94
+ :href="login_path()"
95
+ class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 dark:focus:ring-offset-gray-800"
96
+ >
97
+ Already registered?
98
+ </Link>
99
+
100
+ <PrimaryButton
101
+ class="ms-4"
102
+ :class="{ 'opacity-25': form.processing }"
103
+ :disabled="form.processing"
104
+ >
105
+ Register
106
+ </PrimaryButton>
107
+ </div>
108
+ </form>
109
+ </GuestLayout>
106
110
  </template>
@@ -1,89 +1,92 @@
1
1
  <script setup lang="ts">
2
- import GuestLayout from '@/Layouts/GuestLayout.vue';
3
- import InputError from '@/Components/InputError.vue';
4
- import InputLabel from '@/Components/InputLabel.vue';
5
- import PrimaryButton from '@/Components/PrimaryButton.vue';
6
- import TextInput from '@/Components/TextInput.vue';
7
- import { Head, useForm } from '@inertiajs/vue3';
8
- import { password_store_path } from '@/routes';
2
+ import GuestLayout from '@/Layouts/GuestLayout.vue'
3
+ import InputError from '@/Components/InputError.vue'
4
+ import InputLabel from '@/Components/InputLabel.vue'
5
+ import PrimaryButton from '@/Components/PrimaryButton.vue'
6
+ import TextInput from '@/Components/TextInput.vue'
7
+ import { Head, useForm } from '@inertiajs/vue3'
8
+ import { password_store_path } from '@/routes'
9
9
 
10
10
  const props = defineProps<{
11
- email: string;
12
- token: string;
13
- }>();
11
+ email: string
12
+ token: string
13
+ }>()
14
14
 
15
15
  const form = useForm({
16
- token: props.token,
17
- email: props.email,
18
- password: '',
19
- password_confirmation: '',
20
- });
16
+ token: props.token,
17
+ email: props.email,
18
+ password: '',
19
+ password_confirmation: '',
20
+ })
21
21
 
22
22
  const submit = () => {
23
- form.post(password_store_path(), {
24
- onFinish: () => {
25
- form.reset('password', 'password_confirmation');
26
- },
27
- });
28
- };
23
+ form.post(password_store_path(), {
24
+ onFinish: () => {
25
+ form.reset('password', 'password_confirmation')
26
+ },
27
+ })
28
+ }
29
29
  </script>
30
30
 
31
31
  <template>
32
- <GuestLayout>
33
- <Head title="Reset Password" />
32
+ <GuestLayout>
33
+ <Head title="Reset Password" />
34
34
 
35
- <form @submit.prevent="submit">
36
- <div>
37
- <InputLabel for="email" value="Email" />
35
+ <form @submit.prevent="submit">
36
+ <div>
37
+ <InputLabel for="email" value="Email" />
38
38
 
39
- <TextInput
40
- id="email"
41
- type="email"
42
- class="mt-1 block w-full"
43
- v-model="form.email"
44
- required
45
- autofocus
46
- autocomplete="username"
47
- />
39
+ <TextInput
40
+ id="email"
41
+ type="email"
42
+ class="mt-1 block w-full"
43
+ v-model="form.email"
44
+ required
45
+ autofocus
46
+ autocomplete="username"
47
+ />
48
48
 
49
- <InputError class="mt-2" :message="form.errors.email" />
50
- </div>
49
+ <InputError class="mt-2" :message="form.errors.email" />
50
+ </div>
51
51
 
52
- <div class="mt-4">
53
- <InputLabel for="password" value="Password" />
52
+ <div class="mt-4">
53
+ <InputLabel for="password" value="Password" />
54
54
 
55
- <TextInput
56
- id="password"
57
- type="password"
58
- class="mt-1 block w-full"
59
- v-model="form.password"
60
- required
61
- autocomplete="new-password"
62
- />
55
+ <TextInput
56
+ id="password"
57
+ type="password"
58
+ class="mt-1 block w-full"
59
+ v-model="form.password"
60
+ required
61
+ autocomplete="new-password"
62
+ />
63
63
 
64
- <InputError class="mt-2" :message="form.errors.password" />
65
- </div>
64
+ <InputError class="mt-2" :message="form.errors.password" />
65
+ </div>
66
66
 
67
- <div class="mt-4">
68
- <InputLabel for="password_confirmation" value="Confirm Password" />
67
+ <div class="mt-4">
68
+ <InputLabel for="password_confirmation" value="Confirm Password" />
69
69
 
70
- <TextInput
71
- id="password_confirmation"
72
- type="password"
73
- class="mt-1 block w-full"
74
- v-model="form.password_confirmation"
75
- required
76
- autocomplete="new-password"
77
- />
70
+ <TextInput
71
+ id="password_confirmation"
72
+ type="password"
73
+ class="mt-1 block w-full"
74
+ v-model="form.password_confirmation"
75
+ required
76
+ autocomplete="new-password"
77
+ />
78
78
 
79
- <InputError class="mt-2" :message="form.errors.password_confirmation" />
80
- </div>
79
+ <InputError class="mt-2" :message="form.errors.password_confirmation" />
80
+ </div>
81
81
 
82
- <div class="flex items-center justify-end mt-4">
83
- <PrimaryButton :class="{ 'opacity-25': form.processing }" :disabled="form.processing">
84
- Reset Password
85
- </PrimaryButton>
86
- </div>
87
- </form>
88
- </GuestLayout>
82
+ <div class="flex items-center justify-end mt-4">
83
+ <PrimaryButton
84
+ :class="{ 'opacity-25': form.processing }"
85
+ :disabled="form.processing"
86
+ >
87
+ Reset Password
88
+ </PrimaryButton>
89
+ </div>
90
+ </form>
91
+ </GuestLayout>
89
92
  </template>
@@ -1,22 +1,30 @@
1
1
  <script setup lang="ts">
2
- import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue';
3
- import { Head } from '@inertiajs/vue3';
2
+ import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
3
+ import { Head } from '@inertiajs/vue3'
4
4
  </script>
5
5
 
6
6
  <template>
7
- <Head title="Dashboard" />
7
+ <Head title="Dashboard" />
8
8
 
9
- <AuthenticatedLayout>
10
- <template #header>
11
- <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Dashboard</h2>
12
- </template>
9
+ <AuthenticatedLayout>
10
+ <template #header>
11
+ <h2
12
+ class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight"
13
+ >
14
+ Dashboard
15
+ </h2>
16
+ </template>
13
17
 
14
- <div class="py-12">
15
- <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
16
- <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg">
17
- <div class="p-6 text-gray-900 dark:text-gray-100">You're logged in!</div>
18
- </div>
19
- </div>
18
+ <div class="py-12">
19
+ <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
20
+ <div
21
+ class="bg-white dark:bg-gray-800 overflow-hidden shadow-sm sm:rounded-lg"
22
+ >
23
+ <div class="p-6 text-gray-900 dark:text-gray-100">
24
+ You're logged in!
25
+ </div>
20
26
  </div>
21
- </AuthenticatedLayout>
27
+ </div>
28
+ </div>
29
+ </AuthenticatedLayout>
22
30
  </template>