Feat: 로그인 여부에 따른 메인페이지 이동 및 dashboard 처리

This commit is contained in:
2026-02-05 16:36:42 +09:00
parent ded49b5e2a
commit f1e340d9f1
17 changed files with 497 additions and 73 deletions

View File

@@ -285,7 +285,7 @@ export async function signout() {
revalidatePath("/", "layout");
// 3. 로그인 페이지로 리다이렉트
redirect("/login");
redirect("/");
}
/**

View File

@@ -2,6 +2,7 @@
import { useState } from "react";
import Link from "next/link";
import { AUTH_ROUTES } from "@/features/auth/constants";
import {
login,
signInWithGoogle,
@@ -122,7 +123,7 @@ export default function LoginForm() {
</div>
{/* 비밀번호 찾기 링크 */}
<Link
href="/forgot-password"
href={AUTH_ROUTES.FORGOT_PASSWORD}
className="text-sm font-medium text-gray-700 hover:text-black dark:text-gray-300 dark:hover:text-white"
>
@@ -150,7 +151,7 @@ export default function LoginForm() {
<p className="text-center text-sm text-gray-600 dark:text-gray-400">
?{" "}
<Link
href="/signup"
href={AUTH_ROUTES.SIGNUP}
className="font-semibold text-gray-900 transition-colors hover:text-black dark:text-gray-100 dark:hover:text-white"
>

View File

@@ -180,6 +180,7 @@ export const AUTH_ROUTES = {
AUTH_CONFIRM: "/auth/confirm",
AUTH_CALLBACK: "/auth/callback",
HOME: "/",
DASHBOARD: "/dashboard",
} as const;
/**

View File

@@ -2,6 +2,7 @@ import { createClient } from "@/utils/supabase/server";
import Link from "next/link";
import { UserMenu } from "./user-menu";
import { Button } from "@/components/ui/button";
import { AUTH_ROUTES } from "@/features/auth/constants";
export async function Header() {
const supabase = await createClient();
@@ -12,7 +13,7 @@ export async function Header() {
return (
<header className="sticky top-0 z-40 flex h-14 w-full items-center justify-between border-b border-zinc-200 bg-white/75 px-6 backdrop-blur-md transition-all dark:border-zinc-800 dark:bg-black/75">
<div className="flex items-center gap-2">
<Link href="/" className="flex items-center gap-2">
<Link href={AUTH_ROUTES.DASHBOARD} className="flex items-center gap-2">
<div className="h-6 w-6 rounded-md bg-zinc-900 dark:bg-zinc-50" />
<span className="text-lg font-bold tracking-tight text-zinc-900 dark:text-zinc-50">
AutoTrade
@@ -25,7 +26,7 @@ export async function Header() {
<UserMenu user={user} />
) : (
<Button asChild variant="default" size="sm">
<Link href="/login"></Link>
<Link href={AUTH_ROUTES.LOGIN}></Link>
</Button>
)}
</div>