From 04fbda48fd6d3eb1e0855332bfaf95f113ca14d1 Mon Sep 17 00:00:00 2001 From: myrmidex Date: Sat, 2 May 2026 16:21:01 +0200 Subject: [PATCH] 43 - Delete dead Breeze auth/settings boilerplate, slim auth routes to register-only --- .../Auth/AuthenticatedSessionController.php | 51 ------- .../Auth/ConfirmablePasswordController.php | 41 ------ ...mailVerificationNotificationController.php | 24 ---- .../EmailVerificationPromptController.php | 22 --- .../Auth/NewPasswordController.php | 70 ---------- .../Auth/PasswordResetLinkController.php | 42 ------ .../Auth/VerifyEmailController.php | 31 ----- .../Settings/PasswordController.php | 39 ------ .../Settings/ProfileController.php | 63 --------- .../Settings/AppearanceDropdown.tsx | 53 -------- .../js/components/Settings/AppearanceTabs.tsx | 34 ----- resources/js/layouts/settings/layout.tsx | 68 ---------- resources/js/pages/auth/confirm-password.tsx | 60 -------- resources/js/pages/auth/forgot-password.tsx | 63 --------- resources/js/pages/auth/login.tsx | 110 --------------- resources/js/pages/auth/register.tsx | 119 ---------------- resources/js/pages/auth/reset-password.tsx | 98 -------------- resources/js/pages/auth/verify-email.tsx | 41 ------ resources/js/pages/settings/appearance.tsx | 30 ---- resources/js/pages/settings/password.tsx | 128 ------------------ resources/js/pages/settings/profile.tsx | 127 ----------------- routes/auth.php | 54 +------- routes/settings.php | 21 --- routes/web.php | 1 - testing | Bin 0 -> 139264 bytes 25 files changed, 3 insertions(+), 1387 deletions(-) delete mode 100644 app/Http/Controllers/Auth/AuthenticatedSessionController.php delete mode 100644 app/Http/Controllers/Auth/ConfirmablePasswordController.php delete mode 100644 app/Http/Controllers/Auth/EmailVerificationNotificationController.php delete mode 100644 app/Http/Controllers/Auth/EmailVerificationPromptController.php delete mode 100644 app/Http/Controllers/Auth/NewPasswordController.php delete mode 100644 app/Http/Controllers/Auth/PasswordResetLinkController.php delete mode 100644 app/Http/Controllers/Auth/VerifyEmailController.php delete mode 100644 app/Http/Controllers/Settings/PasswordController.php delete mode 100644 app/Http/Controllers/Settings/ProfileController.php delete mode 100644 resources/js/components/Settings/AppearanceDropdown.tsx delete mode 100644 resources/js/components/Settings/AppearanceTabs.tsx delete mode 100644 resources/js/layouts/settings/layout.tsx delete mode 100644 resources/js/pages/auth/confirm-password.tsx delete mode 100644 resources/js/pages/auth/forgot-password.tsx delete mode 100644 resources/js/pages/auth/login.tsx delete mode 100644 resources/js/pages/auth/register.tsx delete mode 100644 resources/js/pages/auth/reset-password.tsx delete mode 100644 resources/js/pages/auth/verify-email.tsx delete mode 100644 resources/js/pages/settings/appearance.tsx delete mode 100644 resources/js/pages/settings/password.tsx delete mode 100644 resources/js/pages/settings/profile.tsx delete mode 100644 routes/settings.php create mode 100644 testing diff --git a/app/Http/Controllers/Auth/AuthenticatedSessionController.php b/app/Http/Controllers/Auth/AuthenticatedSessionController.php deleted file mode 100644 index b4a48d9..0000000 --- a/app/Http/Controllers/Auth/AuthenticatedSessionController.php +++ /dev/null @@ -1,51 +0,0 @@ - Route::has('password.request'), - 'status' => $request->session()->get('status'), - ]); - } - - /** - * Handle an incoming authentication request. - */ - public function store(LoginRequest $request): RedirectResponse - { - $request->authenticate(); - - $request->session()->regenerate(); - - return redirect()->intended(route('dashboard', absolute: false)); - } - - /** - * Destroy an authenticated session. - */ - public function destroy(Request $request): RedirectResponse - { - Auth::guard('web')->logout(); - - $request->session()->invalidate(); - $request->session()->regenerateToken(); - - return redirect('/'); - } -} diff --git a/app/Http/Controllers/Auth/ConfirmablePasswordController.php b/app/Http/Controllers/Auth/ConfirmablePasswordController.php deleted file mode 100644 index c729706..0000000 --- a/app/Http/Controllers/Auth/ConfirmablePasswordController.php +++ /dev/null @@ -1,41 +0,0 @@ -validate([ - 'email' => $request->user()->email, - 'password' => $request->password, - ])) { - throw ValidationException::withMessages([ - 'password' => __('auth.password'), - ]); - } - - $request->session()->put('auth.password_confirmed_at', time()); - - return redirect()->intended(route('dashboard', absolute: false)); - } -} diff --git a/app/Http/Controllers/Auth/EmailVerificationNotificationController.php b/app/Http/Controllers/Auth/EmailVerificationNotificationController.php deleted file mode 100644 index f64fa9b..0000000 --- a/app/Http/Controllers/Auth/EmailVerificationNotificationController.php +++ /dev/null @@ -1,24 +0,0 @@ -user()->hasVerifiedEmail()) { - return redirect()->intended(route('dashboard', absolute: false)); - } - - $request->user()->sendEmailVerificationNotification(); - - return back()->with('status', 'verification-link-sent'); - } -} diff --git a/app/Http/Controllers/Auth/EmailVerificationPromptController.php b/app/Http/Controllers/Auth/EmailVerificationPromptController.php deleted file mode 100644 index 672f7cf..0000000 --- a/app/Http/Controllers/Auth/EmailVerificationPromptController.php +++ /dev/null @@ -1,22 +0,0 @@ -user()->hasVerifiedEmail() - ? redirect()->intended(route('dashboard', absolute: false)) - : Inertia::render('auth/verify-email', ['status' => $request->session()->get('status')]); - } -} diff --git a/app/Http/Controllers/Auth/NewPasswordController.php b/app/Http/Controllers/Auth/NewPasswordController.php deleted file mode 100644 index 6ab99ef..0000000 --- a/app/Http/Controllers/Auth/NewPasswordController.php +++ /dev/null @@ -1,70 +0,0 @@ - $request->email, - 'token' => $request->route('token'), - ]); - } - - /** - * Handle an incoming new password request. - * - * @throws ValidationException - */ - public function store(Request $request): RedirectResponse - { - $request->validate([ - 'token' => 'required', - 'email' => 'required|email', - 'password' => ['required', 'confirmed', Rules\Password::defaults()], - ]); - - // Here we will attempt to reset the user's password. If it is successful we - // will update the password on an actual user model and persist it to the - // database. Otherwise we will parse the error and return the response. - $status = Password::reset( - $request->only('email', 'password', 'password_confirmation', 'token'), - function (User $user) use ($request) { - $user->forceFill([ - 'password' => Hash::make($request->password), - 'remember_token' => Str::random(60), - ])->save(); - - event(new PasswordReset($user)); - } - ); - - // If the password was successfully reset, we will redirect the user back to - // the application's home authenticated view. If there is an error we can - // redirect them back to where they came from with their error message. - if ($status == Password::PasswordReset) { - return to_route('login')->with('status', __($status)); - } - - throw ValidationException::withMessages([ - 'email' => [__($status)], - ]); - } -} diff --git a/app/Http/Controllers/Auth/PasswordResetLinkController.php b/app/Http/Controllers/Auth/PasswordResetLinkController.php deleted file mode 100644 index 74d46f9..0000000 --- a/app/Http/Controllers/Auth/PasswordResetLinkController.php +++ /dev/null @@ -1,42 +0,0 @@ - $request->session()->get('status'), - ]); - } - - /** - * Handle an incoming password reset link request. - * - * @throws ValidationException - */ - public function store(Request $request): RedirectResponse - { - $request->validate([ - 'email' => 'required|email', - ]); - - Password::sendResetLink( - $request->only('email') - ); - - return back()->with('status', __('A reset link will be sent if the account exists.')); - } -} diff --git a/app/Http/Controllers/Auth/VerifyEmailController.php b/app/Http/Controllers/Auth/VerifyEmailController.php deleted file mode 100644 index bfeef5a..0000000 --- a/app/Http/Controllers/Auth/VerifyEmailController.php +++ /dev/null @@ -1,31 +0,0 @@ -user()->hasVerifiedEmail()) { - return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); - } - - if ($request->user()->markEmailAsVerified()) { - /** @var MustVerifyEmail $user */ - $user = $request->user(); - - event(new Verified($user)); - } - - return redirect()->intended(route('dashboard', absolute: false).'?verified=1'); - } -} diff --git a/app/Http/Controllers/Settings/PasswordController.php b/app/Http/Controllers/Settings/PasswordController.php deleted file mode 100644 index f8d19b9..0000000 --- a/app/Http/Controllers/Settings/PasswordController.php +++ /dev/null @@ -1,39 +0,0 @@ -validate([ - 'current_password' => ['required', 'current_password'], - 'password' => ['required', Password::defaults(), 'confirmed'], - ]); - - $request->user()->update([ - 'password' => Hash::make($validated['password']), - ]); - - return back(); - } -} diff --git a/app/Http/Controllers/Settings/ProfileController.php b/app/Http/Controllers/Settings/ProfileController.php deleted file mode 100644 index a6cb7e1..0000000 --- a/app/Http/Controllers/Settings/ProfileController.php +++ /dev/null @@ -1,63 +0,0 @@ - $request->user() instanceof MustVerifyEmail, - 'status' => $request->session()->get('status'), - ]); - } - - /** - * Update the user's profile settings. - */ - public function update(ProfileUpdateRequest $request): RedirectResponse - { - $request->user()->fill($request->validated()); - - if ($request->user()->isDirty('email')) { - $request->user()->email_verified_at = null; - } - - $request->user()->save(); - - return to_route('profile.edit'); - } - - /** - * Delete the user's account. - */ - public function destroy(Request $request): RedirectResponse - { - $request->validate([ - 'password' => ['required', 'current_password'], - ]); - - $user = $request->user(); - - Auth::logout(); - - $user->delete(); - - $request->session()->invalidate(); - $request->session()->regenerateToken(); - - return redirect('/'); - } -} diff --git a/resources/js/components/Settings/AppearanceDropdown.tsx b/resources/js/components/Settings/AppearanceDropdown.tsx deleted file mode 100644 index ee5032f..0000000 --- a/resources/js/components/Settings/AppearanceDropdown.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { Button } from '@/components/ui/button'; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/DropdownMenu'; -import { useAppearance } from '@/hooks/use-appearance'; -import { Monitor, Moon, Sun } from 'lucide-react'; -import { HTMLAttributes } from 'react'; - -export default function AppearanceToggleDropdown({ className = '', ...props }: HTMLAttributes) { - const { appearance, updateAppearance } = useAppearance(); - - const getCurrentIcon = () => { - switch (appearance) { - case 'dark': - return ; - case 'light': - return ; - default: - return ; - } - }; - - return ( -
- - - - - - updateAppearance('light')}> - - - Light - - - updateAppearance('dark')}> - - - Dark - - - updateAppearance('system')}> - - - System - - - - -
- ); -} diff --git a/resources/js/components/Settings/AppearanceTabs.tsx b/resources/js/components/Settings/AppearanceTabs.tsx deleted file mode 100644 index 900b0f2..0000000 --- a/resources/js/components/Settings/AppearanceTabs.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Appearance, useAppearance } from '@/hooks/use-appearance'; -import { cn } from '@/lib/utils'; -import { LucideIcon, Monitor, Moon, Sun } from 'lucide-react'; -import { HTMLAttributes } from 'react'; - -export default function AppearanceToggleTab({ className = '', ...props }: HTMLAttributes) { - const { appearance, updateAppearance } = useAppearance(); - - const tabs: { value: Appearance; icon: LucideIcon; label: string }[] = [ - { value: 'light', icon: Sun, label: 'Light' }, - { value: 'dark', icon: Moon, label: 'Dark' }, - { value: 'system', icon: Monitor, label: 'System' }, - ]; - - return ( -
- {tabs.map(({ value, icon: Icon, label }) => ( - - ))} -
- ); -} diff --git a/resources/js/layouts/settings/layout.tsx b/resources/js/layouts/settings/layout.tsx deleted file mode 100644 index 47859cd..0000000 --- a/resources/js/layouts/settings/layout.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import Heading from '@/components/heading'; -import { Button } from '@/components/ui/button'; -import { Separator } from '@/components/ui/separator'; -import { cn } from '@/lib/utils'; -import { type NavItem } from '@/types'; -import { Link } from '@inertiajs/react'; -import { type PropsWithChildren } from 'react'; - -const sidebarNavItems: NavItem[] = [ - { - title: 'Profile', - href: '/settings/profile', - icon: null, - }, - { - title: 'Password', - href: '/settings/password', - icon: null, - }, - { - title: 'Appearance', - href: '/settings/appearance', - icon: null, - }, -]; - -export default function SettingsLayout({ children }: PropsWithChildren) { - // When server-side rendering, we only render the layout on the client... - if (typeof window === 'undefined') { - return null; - } - - const currentPath = window.location.pathname; - - return ( -
- - -
- - - - -
-
{children}
-
-
-
- ); -} diff --git a/resources/js/pages/auth/confirm-password.tsx b/resources/js/pages/auth/confirm-password.tsx deleted file mode 100644 index 50907b9..0000000 --- a/resources/js/pages/auth/confirm-password.tsx +++ /dev/null @@ -1,60 +0,0 @@ -// Components -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/InputError'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -export default function ConfirmPassword() { - const { data, setData, post, processing, errors, reset } = useForm>({ - password: '', - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - - post(route('password.confirm'), { - onFinish: () => reset('password'), - }); - }; - - return ( - - - -
-
-
- - setData('password', e.target.value)} - /> - - -
- -
- -
-
-
-
- ); -} diff --git a/resources/js/pages/auth/forgot-password.tsx b/resources/js/pages/auth/forgot-password.tsx deleted file mode 100644 index a69c3bc..0000000 --- a/resources/js/pages/auth/forgot-password.tsx +++ /dev/null @@ -1,63 +0,0 @@ -// Components -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/InputError'; -import TextLink from '@/components/TextLink'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -export default function ForgotPassword({ status }: { status?: string }) { - const { data, setData, post, processing, errors } = useForm>({ - email: '', - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - - post(route('password.email')); - }; - - return ( - - - - {status &&
{status}
} - -
-
-
- - setData('email', e.target.value)} - placeholder="email@example.com" - /> - - -
- -
- -
-
- -
- Or, return to - log in -
-
-
- ); -} diff --git a/resources/js/pages/auth/login.tsx b/resources/js/pages/auth/login.tsx deleted file mode 100644 index 8df7bfd..0000000 --- a/resources/js/pages/auth/login.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/InputError'; -import TextLink from '@/components/TextLink'; -import { Button } from '@/components/ui/button'; -import { Checkbox } from '@/components/ui/checkbox'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -type LoginForm = { - email: string; - password: string; - remember: boolean; -}; - -interface LoginProps { - status?: string; - canResetPassword: boolean; -} - -export default function Login({ status, canResetPassword }: LoginProps) { - const { data, setData, post, processing, errors, reset } = useForm>({ - email: '', - password: '', - remember: false, - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - post(route('login'), { - onFinish: () => reset('password'), - }); - }; - - return ( - - - -
-
-
- - setData('email', e.target.value)} - placeholder="email@example.com" - /> - -
- -
-
- - {canResetPassword && ( - - Forgot password? - - )} -
- setData('password', e.target.value)} - placeholder="Password" - /> - -
- -
- setData('remember', !data.remember)} - tabIndex={3} - /> - -
- - -
- -
- Don't have an account?{' '} - - Sign up - -
-
- - {status &&
{status}
} -
- ); -} diff --git a/resources/js/pages/auth/register.tsx b/resources/js/pages/auth/register.tsx deleted file mode 100644 index 35091ba..0000000 --- a/resources/js/pages/auth/register.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/InputError'; -import TextLink from '@/components/TextLink'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -type RegisterForm = { - name: string; - email: string; - password: string; - password_confirmation: string; -}; - -export default function Register() { - const { data, setData, post, processing, errors, reset } = useForm>({ - name: '', - email: '', - password: '', - password_confirmation: '', - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - post(route('register'), { - onFinish: () => reset('password', 'password_confirmation'), - }); - }; - - return ( - - -
-
-
- - setData('name', e.target.value)} - disabled={processing} - placeholder="Full name" - /> - -
- -
- - setData('email', e.target.value)} - disabled={processing} - placeholder="email@example.com" - /> - -
- -
- - setData('password', e.target.value)} - disabled={processing} - placeholder="Password" - /> - -
- -
- - setData('password_confirmation', e.target.value)} - disabled={processing} - placeholder="Confirm password" - /> - -
- - -
- -
- Already have an account?{' '} - - Log in - -
-
-
- ); -} diff --git a/resources/js/pages/auth/reset-password.tsx b/resources/js/pages/auth/reset-password.tsx deleted file mode 100644 index 816b11d..0000000 --- a/resources/js/pages/auth/reset-password.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import InputError from '@/components/InputError'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AuthLayout from '@/layouts/auth-layout'; - -interface ResetPasswordProps { - token: string; - email: string; -} - -type ResetPasswordForm = { - token: string; - email: string; - password: string; - password_confirmation: string; -}; - -export default function ResetPassword({ token, email }: ResetPasswordProps) { - const { data, setData, post, processing, errors, reset } = useForm>({ - token: token, - email: email, - password: '', - password_confirmation: '', - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - post(route('password.store'), { - onFinish: () => reset('password', 'password_confirmation'), - }); - }; - - return ( - - - -
-
-
- - setData('email', e.target.value)} - /> - -
- -
- - setData('password', e.target.value)} - placeholder="Password" - /> - -
- -
- - setData('password_confirmation', e.target.value)} - placeholder="Confirm password" - /> - -
- - -
-
-
- ); -} diff --git a/resources/js/pages/auth/verify-email.tsx b/resources/js/pages/auth/verify-email.tsx deleted file mode 100644 index ec9a5ce..0000000 --- a/resources/js/pages/auth/verify-email.tsx +++ /dev/null @@ -1,41 +0,0 @@ -// Components -import { Head, useForm } from '@inertiajs/react'; -import { LoaderCircle } from 'lucide-react'; -import { FormEventHandler } from 'react'; - -import TextLink from '@/components/TextLink'; -import { Button } from '@/components/ui/button'; -import AuthLayout from '@/layouts/auth-layout'; - -export default function VerifyEmail({ status }: { status?: string }) { - const { post, processing } = useForm({}); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - - post(route('verification.send')); - }; - - return ( - - - - {status === 'verification-link-sent' && ( -
- A new verification link has been sent to the email address you provided during registration. -
- )} - -
- - - - Log out - -
-
- ); -} diff --git a/resources/js/pages/settings/appearance.tsx b/resources/js/pages/settings/appearance.tsx deleted file mode 100644 index 94ab15a..0000000 --- a/resources/js/pages/settings/appearance.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { Head } from '@inertiajs/react'; - -import AppearanceTabs from '@/components/Settings/AppearanceTabs'; -import HeadingSmall from '@/components/HeadingSmall'; -import { type BreadcrumbItem } from '@/types'; - -import AppLayout from '@/layouts/app-layout'; -import SettingsLayout from '@/layouts/settings/layout'; - -const breadcrumbs: BreadcrumbItem[] = [ - { - title: 'Appearance settings', - href: '/settings/appearance', - }, -]; - -export default function Appearance() { - return ( - - - - -
- - -
-
-
- ); -} diff --git a/resources/js/pages/settings/password.tsx b/resources/js/pages/settings/password.tsx deleted file mode 100644 index 4d16221..0000000 --- a/resources/js/pages/settings/password.tsx +++ /dev/null @@ -1,128 +0,0 @@ -import InputError from '@/components/InputError'; -import AppLayout from '@/layouts/app-layout'; -import SettingsLayout from '@/layouts/settings/layout'; -import { type BreadcrumbItem } from '@/types'; -import { Transition } from '@headlessui/react'; -import { Head, useForm } from '@inertiajs/react'; -import { FormEventHandler, useRef } from 'react'; - -import HeadingSmall from '@/components/HeadingSmall'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; - -const breadcrumbs: BreadcrumbItem[] = [ - { - title: 'Password settings', - href: '/settings/password', - }, -]; - -export default function Password() { - const passwordInput = useRef(null); - const currentPasswordInput = useRef(null); - - const { data, setData, errors, put, reset, processing, recentlySuccessful } = useForm({ - current_password: '', - password: '', - password_confirmation: '', - }); - - const updatePassword: FormEventHandler = (e) => { - e.preventDefault(); - - put(route('password.update'), { - preserveScroll: true, - onSuccess: () => reset(), - onError: (errors) => { - if (errors.password) { - reset('password', 'password_confirmation'); - passwordInput.current?.focus(); - } - - if (errors.current_password) { - reset('current_password'); - currentPasswordInput.current?.focus(); - } - }, - }); - }; - - return ( - - - - -
- - -
-
- - - setData('current_password', e.target.value)} - type="password" - className="mt-1 block w-full" - autoComplete="current-password" - placeholder="Current password" - /> - - -
- -
- - - setData('password', e.target.value)} - type="password" - className="mt-1 block w-full" - autoComplete="new-password" - placeholder="New password" - /> - - -
- -
- - - setData('password_confirmation', e.target.value)} - type="password" - className="mt-1 block w-full" - autoComplete="new-password" - placeholder="Confirm password" - /> - - -
- -
- - - -

Saved

-
-
-
-
-
-
- ); -} diff --git a/resources/js/pages/settings/profile.tsx b/resources/js/pages/settings/profile.tsx deleted file mode 100644 index 25b56be..0000000 --- a/resources/js/pages/settings/profile.tsx +++ /dev/null @@ -1,127 +0,0 @@ -import { type BreadcrumbItem, type SharedData } from '@/types'; -import { Transition } from '@headlessui/react'; -import { Head, Link, useForm, usePage } from '@inertiajs/react'; -import { FormEventHandler } from 'react'; - -import DeleteUser from '@/components/Settings/DeleteUser'; -import HeadingSmall from '@/components/HeadingSmall'; -import InputError from '@/components/InputError'; -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import AppLayout from '@/layouts/app-layout'; -import SettingsLayout from '@/layouts/settings/layout'; - -const breadcrumbs: BreadcrumbItem[] = [ - { - title: 'Profile settings', - href: '/settings/profile', - }, -]; - -type ProfileForm = { - name: string; - email: string; -}; - -export default function Profile({ mustVerifyEmail, status }: { mustVerifyEmail: boolean; status?: string }) { - const { auth } = usePage().props; - - const { data, setData, patch, errors, processing, recentlySuccessful } = useForm>({ - name: auth.user.name, - email: auth.user.email, - }); - - const submit: FormEventHandler = (e) => { - e.preventDefault(); - - patch(route('profile.update'), { - preserveScroll: true, - }); - }; - - return ( - - - - -
- - -
-
- - - setData('name', e.target.value)} - required - autoComplete="name" - placeholder="Full name" - /> - - -
- -
- - - setData('email', e.target.value)} - required - autoComplete="username" - placeholder="Email address" - /> - - -
- - {mustVerifyEmail && auth.user.email_verified_at === null && ( -
-

- Your email address is unverified.{' '} - - Click here to resend the verification email. - -

- - {status === 'verification-link-sent' && ( -
- A new verification link has been sent to your email address. -
- )} -
- )} - -
- - - -

Saved

-
-
-
-
- - -
-
- ); -} diff --git a/routes/auth.php b/routes/auth.php index 7862ed4..7a13564 100644 --- a/routes/auth.php +++ b/routes/auth.php @@ -1,56 +1,8 @@ group(function () { - Route::get('register', [RegisteredUserController::class, 'create']) - ->name('register'); - - Route::post('register', [RegisteredUserController::class, 'store']); - - Route::get('login', [AuthenticatedSessionController::class, 'create']) - ->name('login'); - - Route::post('login', [AuthenticatedSessionController::class, 'store']); - - Route::get('forgot-password', [PasswordResetLinkController::class, 'create']) - ->name('password.request'); - - Route::post('forgot-password', [PasswordResetLinkController::class, 'store']) - ->name('password.email'); - - Route::get('reset-password/{token}', [NewPasswordController::class, 'create']) - ->name('password.reset'); - - Route::post('reset-password', [NewPasswordController::class, 'store']) - ->name('password.store'); -}); - -Route::middleware('auth')->group(function () { - Route::get('verify-email', EmailVerificationPromptController::class) - ->name('verification.notice'); - - Route::get('verify-email/{id}/{hash}', VerifyEmailController::class) - ->middleware(['signed', 'throttle:6,1']) - ->name('verification.verify'); - - Route::post('email/verification-notification', [EmailVerificationNotificationController::class, 'store']) - ->middleware('throttle:6,1') - ->name('verification.send'); - - Route::get('confirm-password', [ConfirmablePasswordController::class, 'show']) - ->name('password.confirm'); - - Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']); - - Route::post('logout', [AuthenticatedSessionController::class, 'destroy']) - ->name('logout'); -}); +// First-run setup only — gated by User::exists() in the controller +Route::get('register', [RegisteredUserController::class, 'create'])->name('register'); +Route::post('register', [RegisteredUserController::class, 'store']); diff --git a/routes/settings.php b/routes/settings.php deleted file mode 100644 index c2e790a..0000000 --- a/routes/settings.php +++ /dev/null @@ -1,21 +0,0 @@ -group(function () { - Route::redirect('settings', '/settings/profile'); - - Route::get('settings/profile', [ProfileController::class, 'edit'])->name('profile.edit'); - Route::patch('settings/profile', [ProfileController::class, 'update'])->name('profile.update'); - Route::delete('settings/profile', [ProfileController::class, 'destroy'])->name('profile.destroy'); - - Route::get('settings/password', [PasswordController::class, 'edit'])->name('password.edit'); - Route::put('settings/password', [PasswordController::class, 'update'])->name('password.update'); - - Route::get('settings/appearance', function () { - return Inertia::render('settings/appearance'); - })->name('appearance'); -}); diff --git a/routes/web.php b/routes/web.php index 1ea1f94..0704ec7 100644 --- a/routes/web.php +++ b/routes/web.php @@ -47,5 +47,4 @@ Route::post('/', [MilestoneController::class, 'store'])->name('store'); }); -require __DIR__.'/settings.php'; require __DIR__.'/auth.php'; diff --git a/testing b/testing new file mode 100644 index 0000000000000000000000000000000000000000..fce68f7e7564368a8ac0591c5d2c738e683c075d GIT binary patch literal 139264 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