From d0dafdadc76733e2d740df002190f07b1c4658a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LAGACHE?= Date: Tue, 23 Jun 2026 16:06:08 +0200 Subject: [PATCH] refactor(auth): reorganize into actions/components/schemas --- app/(auth)/forgot-password/page.tsx | 2 +- app/(auth)/guard/page.tsx | 2 +- app/(auth)/layout.tsx | 2 +- app/(auth)/login/page.tsx | 4 ++-- app/(auth)/register/page.tsx | 2 +- app/(auth)/reset-password/page.tsx | 2 +- src/features/auth/{ => actions}/forgot-password.action.ts | 0 src/features/auth/{ => actions}/reset-password.action.ts | 0 src/features/auth/{ => components}/auth-logo-section.tsx | 0 src/features/auth/{ => components}/forgot-password-form.tsx | 0 src/features/auth/{ => components}/guard-form.tsx | 0 src/features/auth/{ => components}/login-form.tsx | 2 +- src/features/auth/{ => components}/register-form.tsx | 2 +- src/features/auth/{ => components}/reset-password-form.tsx | 0 src/features/auth/{ => components}/social-buttons.tsx | 0 .../auth/{ => schemas}/forgot-password-form.schema.ts | 0 src/features/auth/{ => schemas}/login-form.schema.ts | 0 src/features/auth/{ => schemas}/register-form.schema.ts | 0 src/features/auth/{ => schemas}/reset-password-form.schema.ts | 0 src/features/auth/{ => schemas}/reset-password-page.schema.ts | 0 20 files changed, 9 insertions(+), 9 deletions(-) rename src/features/auth/{ => actions}/forgot-password.action.ts (100%) rename src/features/auth/{ => actions}/reset-password.action.ts (100%) rename src/features/auth/{ => components}/auth-logo-section.tsx (100%) rename src/features/auth/{ => components}/forgot-password-form.tsx (100%) rename src/features/auth/{ => components}/guard-form.tsx (100%) rename src/features/auth/{ => components}/login-form.tsx (98%) rename src/features/auth/{ => components}/register-form.tsx (98%) rename src/features/auth/{ => components}/reset-password-form.tsx (100%) rename src/features/auth/{ => components}/social-buttons.tsx (100%) rename src/features/auth/{ => schemas}/forgot-password-form.schema.ts (100%) rename src/features/auth/{ => schemas}/login-form.schema.ts (100%) rename src/features/auth/{ => schemas}/register-form.schema.ts (100%) rename src/features/auth/{ => schemas}/reset-password-form.schema.ts (100%) rename src/features/auth/{ => schemas}/reset-password-page.schema.ts (100%) diff --git a/app/(auth)/forgot-password/page.tsx b/app/(auth)/forgot-password/page.tsx index 8ee519f4..379ab95c 100644 --- a/app/(auth)/forgot-password/page.tsx +++ b/app/(auth)/forgot-password/page.tsx @@ -1,7 +1,7 @@ import { CardContent, CardHeader } from "@/components/ui/card"; import { TooltipProvider } from "@/components/ui/tooltip"; -import { ForgotPasswordForm } from "@/features/auth/forgot-password-form"; +import { ForgotPasswordForm } from "@/features/auth/components/forgot-password-form"; import { env } from "@/env.mjs"; import { CardAuth } from "@/features/layout/card-auth"; import { redirect } from "next/navigation"; diff --git a/app/(auth)/guard/page.tsx b/app/(auth)/guard/page.tsx index 5fa9bd8c..b0b46b67 100644 --- a/app/(auth)/guard/page.tsx +++ b/app/(auth)/guard/page.tsx @@ -1,6 +1,6 @@ import {CardContent, CardHeader} from "@/components/ui/card"; import {TooltipProvider} from "@/components/ui/tooltip"; -import {GuardForm} from "@/features/auth/guard-form"; +import {GuardForm} from "@/features/auth/components/guard-form"; import {cookies} from "next/headers"; import {redirect} from "next/navigation"; import {CardAuth} from "@/features/layout/card-auth"; diff --git a/app/(auth)/layout.tsx b/app/(auth)/layout.tsx index 6a43921f..9da5af8e 100644 --- a/app/(auth)/layout.tsx +++ b/app/(auth)/layout.tsx @@ -2,7 +2,7 @@ import React from "react"; import { redirect } from "next/navigation"; import { currentUser } from "@/lib/auth/current-user"; import { isOnboardingDone } from "@/db/services/setting"; -import { AuthLogoSection } from "@/features/auth/auth-logo-section"; +import { AuthLogoSection } from "@/features/auth/components/auth-logo-section"; import { env } from "@/env.mjs"; import { Heart } from "lucide-react"; diff --git a/app/(auth)/login/page.tsx b/app/(auth)/login/page.tsx index e225ccf2..8fe44e73 100644 --- a/app/(auth)/login/page.tsx +++ b/app/(auth)/login/page.tsx @@ -1,7 +1,7 @@ -import { LoginForm } from "@/features/auth/login-form"; +import { LoginForm } from "@/features/auth/components/login-form"; import { Metadata } from "next"; import { SUPPORTED_PROVIDERS } from "@/lib/auth/config"; -import { SocialAuthButtons } from "@/features/auth/social-buttons"; +import { SocialAuthButtons } from "@/features/auth/components/social-buttons"; import { TooltipProvider } from "@/components/ui/tooltip"; import { CardContent, CardHeader } from "@/components/ui/card"; import Link from "next/link"; diff --git a/app/(auth)/register/page.tsx b/app/(auth)/register/page.tsx index b97a0f66..c875086a 100644 --- a/app/(auth)/register/page.tsx +++ b/app/(auth)/register/page.tsx @@ -1,5 +1,5 @@ import { PageParams } from "@/types/next"; -import { RegisterForm } from "@/features/auth/register-form"; +import { RegisterForm } from "@/features/auth/components/register-form"; import { Metadata } from "next"; import { redirect } from "next/navigation"; import { env } from "@/env.mjs"; diff --git a/app/(auth)/reset-password/page.tsx b/app/(auth)/reset-password/page.tsx index db5e7cb6..6231e45c 100644 --- a/app/(auth)/reset-password/page.tsx +++ b/app/(auth)/reset-password/page.tsx @@ -1,6 +1,6 @@ import { CardContent, CardHeader } from "@/components/ui/card"; import { TooltipProvider } from "@/components/ui/tooltip"; -import { ResetPasswordForm } from "@/features/auth/reset-password-form"; +import { ResetPasswordForm } from "@/features/auth/components/reset-password-form"; import { redirect } from "next/navigation"; import { auth } from "@/lib/auth/auth"; import { Avatar, AvatarImage, AvatarFallback } from "@radix-ui/react-avatar"; diff --git a/src/features/auth/forgot-password.action.ts b/src/features/auth/actions/forgot-password.action.ts similarity index 100% rename from src/features/auth/forgot-password.action.ts rename to src/features/auth/actions/forgot-password.action.ts diff --git a/src/features/auth/reset-password.action.ts b/src/features/auth/actions/reset-password.action.ts similarity index 100% rename from src/features/auth/reset-password.action.ts rename to src/features/auth/actions/reset-password.action.ts diff --git a/src/features/auth/auth-logo-section.tsx b/src/features/auth/components/auth-logo-section.tsx similarity index 100% rename from src/features/auth/auth-logo-section.tsx rename to src/features/auth/components/auth-logo-section.tsx diff --git a/src/features/auth/forgot-password-form.tsx b/src/features/auth/components/forgot-password-form.tsx similarity index 100% rename from src/features/auth/forgot-password-form.tsx rename to src/features/auth/components/forgot-password-form.tsx diff --git a/src/features/auth/guard-form.tsx b/src/features/auth/components/guard-form.tsx similarity index 100% rename from src/features/auth/guard-form.tsx rename to src/features/auth/components/guard-form.tsx diff --git a/src/features/auth/login-form.tsx b/src/features/auth/components/login-form.tsx similarity index 98% rename from src/features/auth/login-form.tsx rename to src/features/auth/components/login-form.tsx index f6629c4b..0b080357 100644 --- a/src/features/auth/login-form.tsx +++ b/src/features/auth/components/login-form.tsx @@ -19,7 +19,7 @@ import { PasswordInput } from "@/components/ui/password-input"; import { LoginSchema, type LoginType, -} from "@/features/auth/login-form.schema"; +} from "@/features/auth/schemas/login-form.schema"; import { ButtonWithLoading } from "@/components/common/button-with-loading"; import { signIn } from "@/lib/auth/auth-client"; diff --git a/src/features/auth/register-form.tsx b/src/features/auth/components/register-form.tsx similarity index 98% rename from src/features/auth/register-form.tsx rename to src/features/auth/components/register-form.tsx index 249d8b37..f82e65e4 100644 --- a/src/features/auth/register-form.tsx +++ b/src/features/auth/components/register-form.tsx @@ -14,7 +14,7 @@ import { import { RegisterSchema, RegisterType, -} from "@/features/auth/register-form.schema"; +} from "@/features/auth/schemas/register-form.schema"; import { signUp } from "@/lib/auth/auth-client"; import { useZodForm } from "@/components/ui/form"; import { CardAuth } from "@/features/layout/card-auth"; diff --git a/src/features/auth/reset-password-form.tsx b/src/features/auth/components/reset-password-form.tsx similarity index 100% rename from src/features/auth/reset-password-form.tsx rename to src/features/auth/components/reset-password-form.tsx diff --git a/src/features/auth/social-buttons.tsx b/src/features/auth/components/social-buttons.tsx similarity index 100% rename from src/features/auth/social-buttons.tsx rename to src/features/auth/components/social-buttons.tsx diff --git a/src/features/auth/forgot-password-form.schema.ts b/src/features/auth/schemas/forgot-password-form.schema.ts similarity index 100% rename from src/features/auth/forgot-password-form.schema.ts rename to src/features/auth/schemas/forgot-password-form.schema.ts diff --git a/src/features/auth/login-form.schema.ts b/src/features/auth/schemas/login-form.schema.ts similarity index 100% rename from src/features/auth/login-form.schema.ts rename to src/features/auth/schemas/login-form.schema.ts diff --git a/src/features/auth/register-form.schema.ts b/src/features/auth/schemas/register-form.schema.ts similarity index 100% rename from src/features/auth/register-form.schema.ts rename to src/features/auth/schemas/register-form.schema.ts diff --git a/src/features/auth/reset-password-form.schema.ts b/src/features/auth/schemas/reset-password-form.schema.ts similarity index 100% rename from src/features/auth/reset-password-form.schema.ts rename to src/features/auth/schemas/reset-password-form.schema.ts diff --git a/src/features/auth/reset-password-page.schema.ts b/src/features/auth/schemas/reset-password-page.schema.ts similarity index 100% rename from src/features/auth/reset-password-page.schema.ts rename to src/features/auth/schemas/reset-password-page.schema.ts