-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: session 여부에 따른 Auth 페이지 라우팅 처리 #3
- Loading branch information
1 parent
82b0e09
commit 1dce9db
Showing
1 changed file
with
10 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 /> | ||
} |