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