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,42 +1,46 @@
1
1
  <script setup lang="ts">
2
- import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue';
3
- import DeleteUserForm from './Partials/DeleteUserForm.vue';
4
- import UpdatePasswordForm from './Partials/UpdatePasswordForm.vue';
5
- import UpdateProfileInformationForm from './Partials/UpdateProfileInformationForm.vue';
6
- import { Head } from '@inertiajs/vue3';
2
+ import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout.vue'
3
+ import DeleteUserForm from './Partials/DeleteUserForm.vue'
4
+ import UpdatePasswordForm from './Partials/UpdatePasswordForm.vue'
5
+ import UpdateProfileInformationForm from './Partials/UpdateProfileInformationForm.vue'
6
+ import { Head } from '@inertiajs/vue3'
7
7
 
8
8
  defineProps<{
9
- mustVerifyEmail?: boolean;
10
- status?: string;
11
- }>();
9
+ mustVerifyEmail?: boolean
10
+ status?: string
11
+ }>()
12
12
  </script>
13
13
 
14
14
  <template>
15
- <Head title="Profile" />
15
+ <Head title="Profile" />
16
16
 
17
- <AuthenticatedLayout>
18
- <template #header>
19
- <h2 class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">Profile</h2>
20
- </template>
17
+ <AuthenticatedLayout>
18
+ <template #header>
19
+ <h2
20
+ class="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight"
21
+ >
22
+ Profile
23
+ </h2>
24
+ </template>
21
25
 
22
- <div class="py-12">
23
- <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
24
- <div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
25
- <UpdateProfileInformationForm
26
- :must-verify-email="mustVerifyEmail"
27
- :status="status"
28
- class="max-w-xl"
29
- />
30
- </div>
26
+ <div class="py-12">
27
+ <div class="max-w-7xl mx-auto sm:px-6 lg:px-8 space-y-6">
28
+ <div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
29
+ <UpdateProfileInformationForm
30
+ :must-verify-email="mustVerifyEmail"
31
+ :status="status"
32
+ class="max-w-xl"
33
+ />
34
+ </div>
31
35
 
32
- <div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
33
- <UpdatePasswordForm class="max-w-xl" />
34
- </div>
36
+ <div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
37
+ <UpdatePasswordForm class="max-w-xl" />
38
+ </div>
35
39
 
36
- <div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
37
- <DeleteUserForm class="max-w-xl" />
38
- </div>
39
- </div>
40
+ <div class="p-4 sm:p-8 bg-white dark:bg-gray-800 shadow sm:rounded-lg">
41
+ <DeleteUserForm class="max-w-xl" />
40
42
  </div>
41
- </AuthenticatedLayout>
43
+ </div>
44
+ </div>
45
+ </AuthenticatedLayout>
42
46
  </template>
@@ -1,98 +1,102 @@
1
1
  <script setup lang="ts">
2
- import DangerButton from '@/Components/DangerButton.vue';
3
- import InputError from '@/Components/InputError.vue';
4
- import InputLabel from '@/Components/InputLabel.vue';
5
- import Modal from '@/Components/Modal.vue';
6
- import SecondaryButton from '@/Components/SecondaryButton.vue';
7
- import TextInput from '@/Components/TextInput.vue';
8
- import { useForm } from '@inertiajs/vue3';
9
- import { nextTick, ref } from 'vue';
10
- import { profile_destroy_path } from '@/routes';
11
-
12
- const confirmingUserDeletion = ref(false);
13
- const passwordInput = ref<HTMLInputElement | null>(null);
2
+ import DangerButton from '@/Components/DangerButton.vue'
3
+ import InputError from '@/Components/InputError.vue'
4
+ import InputLabel from '@/Components/InputLabel.vue'
5
+ import Modal from '@/Components/Modal.vue'
6
+ import SecondaryButton from '@/Components/SecondaryButton.vue'
7
+ import TextInput from '@/Components/TextInput.vue'
8
+ import { useForm } from '@inertiajs/vue3'
9
+ import { nextTick, ref } from 'vue'
10
+ import { profile_destroy_path } from '@/routes'
11
+
12
+ const confirmingUserDeletion = ref(false)
13
+ const passwordInput = ref<HTMLInputElement | null>(null)
14
14
 
15
15
  const form = useForm({
16
- password: '',
17
- });
16
+ password: '',
17
+ })
18
18
 
19
19
  const confirmUserDeletion = () => {
20
- confirmingUserDeletion.value = true;
20
+ confirmingUserDeletion.value = true
21
21
 
22
- nextTick(() => passwordInput.value?.focus());
23
- };
22
+ nextTick(() => passwordInput.value?.focus())
23
+ }
24
24
 
25
25
  const deleteUser = () => {
26
- form.delete(profile_destroy_path(), {
27
- preserveScroll: true,
28
- onSuccess: () => closeModal(),
29
- onError: () => passwordInput.value?.focus(),
30
- onFinish: () => {
31
- form.reset();
32
- },
33
- });
34
- };
26
+ form.delete(profile_destroy_path(), {
27
+ preserveScroll: true,
28
+ onSuccess: () => closeModal(),
29
+ onError: () => passwordInput.value?.focus(),
30
+ onFinish: () => {
31
+ form.reset()
32
+ },
33
+ })
34
+ }
35
35
 
36
36
  const closeModal = () => {
37
- confirmingUserDeletion.value = false;
37
+ confirmingUserDeletion.value = false
38
38
 
39
- form.reset();
40
- };
39
+ form.reset()
40
+ }
41
41
  </script>
42
42
 
43
43
  <template>
44
- <section class="space-y-6">
45
- <header>
46
- <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">Delete Account</h2>
47
-
48
- <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
49
- Once your account is deleted, all of its resources and data will be permanently deleted. Before deleting
50
- your account, please download any data or information that you wish to retain.
51
- </p>
52
- </header>
53
-
54
- <DangerButton @click="confirmUserDeletion">Delete Account</DangerButton>
55
-
56
- <Modal :show="confirmingUserDeletion" @close="closeModal">
57
- <div class="p-6">
58
- <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
59
- Are you sure you want to delete your account?
60
- </h2>
61
-
62
- <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
63
- Once your account is deleted, all of its resources and data will be permanently deleted. Please
64
- enter your password to confirm you would like to permanently delete your account.
65
- </p>
66
-
67
- <div class="mt-6">
68
- <InputLabel for="password" value="Password" class="sr-only" />
69
-
70
- <TextInput
71
- id="password"
72
- ref="passwordInput"
73
- v-model="form.password"
74
- type="password"
75
- class="mt-1 block w-3/4"
76
- placeholder="Password"
77
- @keyup.enter="deleteUser"
78
- />
79
-
80
- <InputError :message="form.errors.password" class="mt-2" />
81
- </div>
82
-
83
- <div class="mt-6 flex justify-end">
84
- <SecondaryButton @click="closeModal"> Cancel </SecondaryButton>
85
-
86
- <DangerButton
87
- class="ms-3"
88
- :class="{ 'opacity-25': form.processing }"
89
- :disabled="form.processing"
90
- @click="deleteUser"
91
- >
92
- Delete Account
93
- </DangerButton>
94
- </div>
95
- </div>
96
- </Modal>
97
- </section>
44
+ <section class="space-y-6">
45
+ <header>
46
+ <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
47
+ Delete Account
48
+ </h2>
49
+
50
+ <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
51
+ Once your account is deleted, all of its resources and data will be
52
+ permanently deleted. Before deleting your account, please download any
53
+ data or information that you wish to retain.
54
+ </p>
55
+ </header>
56
+
57
+ <DangerButton @click="confirmUserDeletion">Delete Account</DangerButton>
58
+
59
+ <Modal :show="confirmingUserDeletion" @close="closeModal">
60
+ <div class="p-6">
61
+ <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
62
+ Are you sure you want to delete your account?
63
+ </h2>
64
+
65
+ <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
66
+ Once your account is deleted, all of its resources and data will be
67
+ permanently deleted. Please enter your password to confirm you would
68
+ like to permanently delete your account.
69
+ </p>
70
+
71
+ <div class="mt-6">
72
+ <InputLabel for="password" value="Password" class="sr-only" />
73
+
74
+ <TextInput
75
+ id="password"
76
+ ref="passwordInput"
77
+ v-model="form.password"
78
+ type="password"
79
+ class="mt-1 block w-3/4"
80
+ placeholder="Password"
81
+ @keyup.enter="deleteUser"
82
+ />
83
+
84
+ <InputError :message="form.errors.password" class="mt-2" />
85
+ </div>
86
+
87
+ <div class="mt-6 flex justify-end">
88
+ <SecondaryButton @click="closeModal"> Cancel </SecondaryButton>
89
+
90
+ <DangerButton
91
+ class="ms-3"
92
+ :class="{ 'opacity-25': form.processing }"
93
+ :disabled="form.processing"
94
+ @click="deleteUser"
95
+ >
96
+ Delete Account
97
+ </DangerButton>
98
+ </div>
99
+ </div>
100
+ </Modal>
101
+ </section>
98
102
  </template>
@@ -1,108 +1,115 @@
1
1
  <script setup lang="ts">
2
- import InputError from '@/Components/InputError.vue';
3
- import InputLabel from '@/Components/InputLabel.vue';
4
- import PrimaryButton from '@/Components/PrimaryButton.vue';
5
- import TextInput from '@/Components/TextInput.vue';
6
- import { useForm } from '@inertiajs/vue3';
7
- import { ref } from 'vue';
8
- import { password_update_path } from '@/routes';
2
+ import InputError from '@/Components/InputError.vue'
3
+ import InputLabel from '@/Components/InputLabel.vue'
4
+ import PrimaryButton from '@/Components/PrimaryButton.vue'
5
+ import TextInput from '@/Components/TextInput.vue'
6
+ import { useForm } from '@inertiajs/vue3'
7
+ import { ref } from 'vue'
8
+ import { password_update_path } from '@/routes'
9
9
 
10
- const passwordInput = ref<HTMLInputElement | null>(null);
11
- const currentPasswordInput = ref<HTMLInputElement | null>(null);
10
+ const passwordInput = ref<HTMLInputElement | null>(null)
11
+ const currentPasswordInput = ref<HTMLInputElement | null>(null)
12
12
 
13
13
  const form = useForm({
14
- current_password: '',
15
- password: '',
16
- password_confirmation: '',
17
- });
14
+ current_password: '',
15
+ password: '',
16
+ password_confirmation: '',
17
+ })
18
18
 
19
19
  const updatePassword = () => {
20
- form.put(password_update_path(), {
21
- preserveScroll: true,
22
- onSuccess: () => {
23
- form.reset();
24
- },
25
- onError: () => {
26
- if (form.errors.password) {
27
- form.reset('password', 'password_confirmation');
28
- passwordInput.value?.focus();
29
- }
30
- if (form.errors.current_password) {
31
- form.reset('current_password');
32
- currentPasswordInput.value?.focus();
33
- }
34
- },
35
- });
36
- };
20
+ form.put(password_update_path(), {
21
+ preserveScroll: true,
22
+ onSuccess: () => {
23
+ form.reset()
24
+ },
25
+ onError: () => {
26
+ if (form.errors.password) {
27
+ form.reset('password', 'password_confirmation')
28
+ passwordInput.value?.focus()
29
+ }
30
+ if (form.errors.current_password) {
31
+ form.reset('current_password')
32
+ currentPasswordInput.value?.focus()
33
+ }
34
+ },
35
+ })
36
+ }
37
37
  </script>
38
38
 
39
39
  <template>
40
- <section>
41
- <header>
42
- <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">Update Password</h2>
43
-
44
- <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
45
- Ensure your account is using a long, random password to stay secure.
46
- </p>
47
- </header>
48
-
49
- <form @submit.prevent="updatePassword" class="mt-6 space-y-6">
50
- <div>
51
- <InputLabel for="current_password" value="Current Password" />
52
-
53
- <TextInput
54
- id="current_password"
55
- ref="currentPasswordInput"
56
- v-model="form.current_password"
57
- type="password"
58
- class="mt-1 block w-full"
59
- autocomplete="current-password"
60
- />
61
-
62
- <InputError :message="form.errors.current_password" class="mt-2" />
63
- </div>
64
-
65
- <div>
66
- <InputLabel for="password" value="New Password" />
67
-
68
- <TextInput
69
- id="password"
70
- ref="passwordInput"
71
- v-model="form.password"
72
- type="password"
73
- class="mt-1 block w-full"
74
- autocomplete="new-password"
75
- />
76
-
77
- <InputError :message="form.errors.password" class="mt-2" />
78
- </div>
79
-
80
- <div>
81
- <InputLabel for="password_confirmation" value="Confirm Password" />
82
-
83
- <TextInput
84
- id="password_confirmation"
85
- v-model="form.password_confirmation"
86
- type="password"
87
- class="mt-1 block w-full"
88
- autocomplete="new-password"
89
- />
90
-
91
- <InputError :message="form.errors.password_confirmation" class="mt-2" />
92
- </div>
93
-
94
- <div class="flex items-center gap-4">
95
- <PrimaryButton :disabled="form.processing">Save</PrimaryButton>
96
-
97
- <Transition
98
- enter-active-class="transition ease-in-out"
99
- enter-from-class="opacity-0"
100
- leave-active-class="transition ease-in-out"
101
- leave-to-class="opacity-0"
102
- >
103
- <p v-if="form.recentlySuccessful" class="text-sm text-gray-600 dark:text-gray-400">Saved.</p>
104
- </Transition>
105
- </div>
106
- </form>
107
- </section>
40
+ <section>
41
+ <header>
42
+ <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
43
+ Update Password
44
+ </h2>
45
+
46
+ <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
47
+ Ensure your account is using a long, random password to stay secure.
48
+ </p>
49
+ </header>
50
+
51
+ <form @submit.prevent="updatePassword" class="mt-6 space-y-6">
52
+ <div>
53
+ <InputLabel for="current_password" value="Current Password" />
54
+
55
+ <TextInput
56
+ id="current_password"
57
+ ref="currentPasswordInput"
58
+ v-model="form.current_password"
59
+ type="password"
60
+ class="mt-1 block w-full"
61
+ autocomplete="current-password"
62
+ />
63
+
64
+ <InputError :message="form.errors.current_password" class="mt-2" />
65
+ </div>
66
+
67
+ <div>
68
+ <InputLabel for="password" value="New Password" />
69
+
70
+ <TextInput
71
+ id="password"
72
+ ref="passwordInput"
73
+ v-model="form.password"
74
+ type="password"
75
+ class="mt-1 block w-full"
76
+ autocomplete="new-password"
77
+ />
78
+
79
+ <InputError :message="form.errors.password" class="mt-2" />
80
+ </div>
81
+
82
+ <div>
83
+ <InputLabel for="password_confirmation" value="Confirm Password" />
84
+
85
+ <TextInput
86
+ id="password_confirmation"
87
+ v-model="form.password_confirmation"
88
+ type="password"
89
+ class="mt-1 block w-full"
90
+ autocomplete="new-password"
91
+ />
92
+
93
+ <InputError :message="form.errors.password_confirmation" class="mt-2" />
94
+ </div>
95
+
96
+ <div class="flex items-center gap-4">
97
+ <PrimaryButton :disabled="form.processing">Save</PrimaryButton>
98
+
99
+ <Transition
100
+ enter-active-class="transition ease-in-out"
101
+ enter-from-class="opacity-0"
102
+ leave-active-class="transition ease-in-out"
103
+ leave-to-class="opacity-0"
104
+ >
105
+ <p
106
+ v-if="form.recentlySuccessful"
107
+ class="text-sm text-gray-600 dark:text-gray-400"
108
+ >
109
+ Saved.
110
+ </p>
111
+ </Transition>
112
+ </div>
113
+ </form>
114
+ </section>
108
115
  </template>
@@ -1,78 +1,88 @@
1
1
  <script setup lang="ts">
2
- import InputError from '@/Components/InputError.vue';
3
- import InputLabel from '@/Components/InputLabel.vue';
4
- import PrimaryButton from '@/Components/PrimaryButton.vue';
5
- import TextInput from '@/Components/TextInput.vue';
6
- import { Link, useForm, usePage } from '@inertiajs/vue3';
7
- import { profile_update_path } from '@/routes';
2
+ import InputError from '@/Components/InputError.vue'
3
+ import InputLabel from '@/Components/InputLabel.vue'
4
+ import PrimaryButton from '@/Components/PrimaryButton.vue'
5
+ import TextInput from '@/Components/TextInput.vue'
6
+ import { useForm, usePage } from '@inertiajs/vue3'
7
+ import { profile_update_path } from '@/routes'
8
8
 
9
9
  defineProps<{
10
- mustVerifyEmail?: Boolean;
11
- status?: String;
12
- }>();
10
+ mustVerifyEmail?: Boolean
11
+ status?: String
12
+ }>()
13
13
 
14
- const user = usePage().props.auth.user;
14
+ const user = usePage().props.auth.user
15
15
 
16
16
  const form = useForm({
17
- name: user.name,
18
- email: user.email,
19
- });
17
+ name: user.name,
18
+ email: user.email,
19
+ })
20
20
  </script>
21
21
 
22
22
  <template>
23
- <section>
24
- <header>
25
- <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">Profile Information</h2>
23
+ <section>
24
+ <header>
25
+ <h2 class="text-lg font-medium text-gray-900 dark:text-gray-100">
26
+ Profile Information
27
+ </h2>
26
28
 
27
- <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
28
- Update your account's profile information and email address.
29
- </p>
30
- </header>
29
+ <p class="mt-1 text-sm text-gray-600 dark:text-gray-400">
30
+ Update your account's profile information and email address.
31
+ </p>
32
+ </header>
31
33
 
32
- <form @submit.prevent="form.patch(profile_update_path())" class="mt-6 space-y-6">
33
- <div>
34
- <InputLabel for="name" value="Name" />
34
+ <form
35
+ @submit.prevent="form.patch(profile_update_path())"
36
+ class="mt-6 space-y-6"
37
+ >
38
+ <div>
39
+ <InputLabel for="name" value="Name" />
35
40
 
36
- <TextInput
37
- id="name"
38
- type="text"
39
- class="mt-1 block w-full"
40
- v-model="form.name"
41
- required
42
- autofocus
43
- autocomplete="name"
44
- />
41
+ <TextInput
42
+ id="name"
43
+ type="text"
44
+ class="mt-1 block w-full"
45
+ v-model="form.name"
46
+ required
47
+ autofocus
48
+ autocomplete="name"
49
+ />
45
50
 
46
- <InputError class="mt-2" :message="form.errors.name" />
47
- </div>
51
+ <InputError class="mt-2" :message="form.errors.name" />
52
+ </div>
48
53
 
49
- <div>
50
- <InputLabel for="email" value="Email" />
54
+ <div>
55
+ <InputLabel for="email" value="Email" />
51
56
 
52
- <TextInput
53
- id="email"
54
- type="email"
55
- class="mt-1 block w-full"
56
- v-model="form.email"
57
- required
58
- autocomplete="username"
59
- />
57
+ <TextInput
58
+ id="email"
59
+ type="email"
60
+ class="mt-1 block w-full"
61
+ v-model="form.email"
62
+ required
63
+ autocomplete="username"
64
+ />
60
65
 
61
- <InputError class="mt-2" :message="form.errors.email" />
62
- </div>
66
+ <InputError class="mt-2" :message="form.errors.email" />
67
+ </div>
63
68
 
64
- <div class="flex items-center gap-4">
65
- <PrimaryButton :disabled="form.processing">Save</PrimaryButton>
69
+ <div class="flex items-center gap-4">
70
+ <PrimaryButton :disabled="form.processing">Save</PrimaryButton>
66
71
 
67
- <Transition
68
- enter-active-class="transition ease-in-out"
69
- enter-from-class="opacity-0"
70
- leave-active-class="transition ease-in-out"
71
- leave-to-class="opacity-0"
72
- >
73
- <p v-if="form.recentlySuccessful" class="text-sm text-gray-600 dark:text-gray-400">Saved.</p>
74
- </Transition>
75
- </div>
76
- </form>
77
- </section>
72
+ <Transition
73
+ enter-active-class="transition ease-in-out"
74
+ enter-from-class="opacity-0"
75
+ leave-active-class="transition ease-in-out"
76
+ leave-to-class="opacity-0"
77
+ >
78
+ <p
79
+ v-if="form.recentlySuccessful"
80
+ class="text-sm text-gray-600 dark:text-gray-400"
81
+ >
82
+ Saved.
83
+ </p>
84
+ </Transition>
85
+ </div>
86
+ </form>
87
+ </section>
78
88
  </template>