Skip to content

Commit

Permalink
feat: session 여부에 따른 Auth 페이지 라우팅 처리 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunjun9788 committed Jan 31, 2025
1 parent 82b0e09 commit 1dce9db
Showing 1 changed file with 10 additions and 31 deletions.
41 changes: 10 additions & 31 deletions src/app/(routes)/(root)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
import HeaderFooterWrapper from "@/components/layout/HeaderFooterWrapper"
import { GoogleSymbol } from "@/icons/GoogleSymbol"
import { KakaoSymbol } from "@/icons/KakaoSymbol"
import { getServerSession } from "next-auth"
import Auth from "../auth/page"
import { authOptions } from "@/app/api/auth/[...nextauth]/auth"
import TestButton from "@/components/TestButton"

import Image from "next/image"

export default function Home() {
return (
<HeaderFooterWrapper header footer>
<div className="mb-6 mt-[58px] flex justify-center">
<section className="flex w-full flex-col gap-[57px] px-4">
<div className="flex flex-col items-center gap-10">
<div className="text-center text-2xl font-semibold">
친구와 무전을 주고 받으며
<br />더 알아갈 수 있어요.
</div>
<Image src="https://placehold.co/229x229.png" width={229} height={229} alt="일러스트 이미지" />
</div>
<div className="flex w-full flex-col gap-3">
<button className="flex items-center justify-center gap-3 rounded-xl border border-[#9CAAB9] py-4 hover:opacity-70 active:opacity-80">
<GoogleSymbol />
Google로 시작하기
</button>
<button className="flex items-center justify-center gap-3 rounded-xl bg-[#FEE500] py-4 hover:opacity-70 active:opacity-80">
<KakaoSymbol />
<span>카카오로 시작하기</span>
</button>
</div>
</section>
</div>
</HeaderFooterWrapper>
)
export default async function Home() {
const session = await getServerSession(authOptions)
if (!session) {
return <Auth />
}
return <TestButton />
}

0 comments on commit 1dce9db

Please sign in to comment.