-
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.
Merge pull request #20 from GDSC-Hongik/feature/login
[Feature] 로그인 구현
- Loading branch information
Showing
70 changed files
with
9,647 additions
and
8,024 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
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
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { fetcher } from "@wow-class/utils"; | ||
import { apiPath } from "constants/apiPath"; | ||
import { tags } from "constants/tags"; | ||
import { cookies } from "next/headers"; | ||
import type { DashboardApiResponseDto } from "types/dtos/auth"; | ||
|
||
export const dashboardApi = { | ||
getDashboardInfo: async () => { | ||
const cookieStore = cookies(); | ||
const accessToken = cookieStore.get("accessToken")?.value; | ||
|
||
// NOTE: middleware에서 호출하기 위해서 별도로 헤더 주입 | ||
const response = await fetcher.get<DashboardApiResponseDto>( | ||
apiPath.dashboard, | ||
{ | ||
next: { tags: [tags.dashboard] }, | ||
headers: { | ||
Authorization: `Bearer ${accessToken}`, | ||
}, | ||
} | ||
); | ||
|
||
const memberRole = response.data?.member.role; | ||
const currentRecruitmentOpen = | ||
response.data?.currentRecruitmentRound?.period.open || false; | ||
|
||
return { memberRole, currentRecruitmentOpen }; | ||
}, | ||
}; |
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,5 +1,5 @@ | ||
const MyHomework = () => { | ||
const MyHomeworkPage = () => { | ||
return <div>MyHomework</div>; | ||
}; | ||
|
||
export default MyHomework; | ||
export default MyHomeworkPage; |
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,5 +1,5 @@ | ||
const MyStudy = () => { | ||
const MyStudyPage = () => { | ||
return <div>MyStudy</div>; | ||
}; | ||
|
||
export default MyStudy; | ||
export default MyStudyPage; |
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,5 +1,5 @@ | ||
const StudyApply = () => { | ||
const StudyApplyPage = () => { | ||
return <div>StudyApply</div>; | ||
}; | ||
|
||
export default StudyApply; | ||
export default StudyApplyPage; |
81 changes: 81 additions & 0 deletions
81
apps/client/app/(beforeLogin)/(auth-error)/auth-error-after-recruitment/page.tsx
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
"use client"; | ||
|
||
import { css } from "@styled-system/css"; | ||
import { Text } from "@wow-class/ui"; | ||
import { routePath } from "constants/routePath"; | ||
import Image from "next/image"; | ||
import { useRouter } from "next/navigation"; | ||
import Button from "wowds-ui/Button"; | ||
|
||
const AuthErrorAfterRecruitmentPage = () => { | ||
const router = useRouter(); | ||
|
||
const handleClickNavigateHome = () => { | ||
router.push(routePath.landing); | ||
}; | ||
|
||
return ( | ||
<main className={mainContentStyle}> | ||
<Image | ||
alt="avatar-image" | ||
className={avatarImageStyle} | ||
height={200} | ||
src="/images/avatar.svg" | ||
width={200} | ||
/> | ||
<Text as="h1" className={headingStyle} typo="display2"> | ||
GDSC Hongik 정회원만 이용 가능해요. | ||
</Text> | ||
<p className={descriptionStyle}> | ||
GDSC Hongik 정회원 모집 기간이 아니에요! | ||
<br /> | ||
모집 기간에 합류 후 이용해주세요. | ||
</p> | ||
<div className={buttonContainerStyle}> | ||
<Button aria-label="홈으로 이동" onClick={handleClickNavigateHome}> | ||
홈으로 이동 | ||
</Button> | ||
</div> | ||
</main> | ||
); | ||
}; | ||
|
||
export default AuthErrorAfterRecruitmentPage; | ||
|
||
const mainContentStyle = css({ | ||
display: "flex", | ||
flexDirection: "column", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
width: "100vw", | ||
height: "100vh", | ||
textAlign: "center", | ||
}); | ||
|
||
const avatarImageStyle = css({ | ||
width: "200px", | ||
height: "200px", | ||
marginBottom: "48px", | ||
}); | ||
|
||
const headingStyle = css({ | ||
marginBottom: "16px", | ||
}); | ||
|
||
const descriptionStyle = css({ | ||
fontSize: "18px", | ||
fontWeight: 500, | ||
lineHeight: "160%", | ||
letterSpacing: "-0.18px", | ||
color: "sub", | ||
marginBottom: "48px", | ||
}); | ||
|
||
const buttonContainerStyle = css({ | ||
display: "flex", | ||
flexDirection: "column", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
gap: "12px", | ||
width: "100%", | ||
}); |
92 changes: 92 additions & 0 deletions
92
apps/client/app/(beforeLogin)/(auth-error)/auth-error-during-recruitment/page.tsx
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
"use client"; | ||
|
||
import { css } from "@styled-system/css"; | ||
import { Text } from "@wow-class/ui"; | ||
import { routePath } from "constants/routePath"; | ||
import Image from "next/image"; | ||
import { useRouter } from "next/navigation"; | ||
import Button from "wowds-ui/Button"; | ||
|
||
const AuthErrorDuringRecruitmentPage = () => { | ||
const router = useRouter(); | ||
|
||
const handleClickNavigateHome = () => { | ||
router.push(routePath.landing); | ||
}; | ||
|
||
const handleClickNavigateOnboarding = () => { | ||
router.push(routePath.onboarding); | ||
}; | ||
|
||
return ( | ||
<main className={mainContentStyle}> | ||
<Image | ||
alt="avatar-image" | ||
className={avatarImageStyle} | ||
height={200} | ||
src="/images/avatar.svg" | ||
width={200} | ||
/> | ||
<Text as="h1" className={headingStyle} typo="display2"> | ||
GDSC Hongik 정회원만 이용 가능해요. | ||
</Text> | ||
<p className={descriptionStyle}> | ||
이번 학기 GDSC Hongik 정회원 모집 중이에요. | ||
<br /> | ||
아래 버튼을 눌러 가입할 수 있어요! | ||
</p> | ||
<div className={buttonContainerStyle}> | ||
<Button aria-label="홈으로 이동" onClick={handleClickNavigateHome}> | ||
홈으로 이동 | ||
</Button> | ||
<Button | ||
aria-label="GDSC Hongik 가입하기" | ||
variant="outline" | ||
onClick={handleClickNavigateOnboarding} | ||
> | ||
GDSC Hongik 가입하기 | ||
</Button> | ||
</div> | ||
</main> | ||
); | ||
}; | ||
|
||
export default AuthErrorDuringRecruitmentPage; | ||
|
||
const mainContentStyle = css({ | ||
display: "flex", | ||
flexDirection: "column", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
width: "100vw", | ||
height: "100vh", | ||
textAlign: "center", | ||
}); | ||
|
||
const avatarImageStyle = css({ | ||
width: "200px", | ||
height: "200px", | ||
marginBottom: "48px", | ||
}); | ||
|
||
const headingStyle = css({ | ||
marginBottom: "16px", | ||
}); | ||
|
||
const descriptionStyle = css({ | ||
fontSize: "18px", | ||
fontWeight: 500, | ||
lineHeight: "160%", | ||
letterSpacing: "-0.18px", | ||
color: "sub", | ||
marginBottom: "48px", | ||
}); | ||
|
||
const buttonContainerStyle = css({ | ||
display: "flex", | ||
flexDirection: "column", | ||
justifyContent: "center", | ||
alignItems: "center", | ||
gap: "12px", | ||
width: "100%", | ||
}); |
36 changes: 36 additions & 0 deletions
36
apps/client/app/(beforeLogin)/auth/_components/LoginButton.tsx
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"use client"; | ||
|
||
import { baseUrl } from "constants/environment"; | ||
import Image from "next/image"; | ||
import { useRouter } from "next/navigation"; | ||
import { color } from "wowds-tokens"; | ||
import Button from "wowds-ui/Button"; | ||
|
||
const LoginButton = () => { | ||
const router = useRouter(); | ||
|
||
const handleClickLogin = () => { | ||
router.push(`${baseUrl}/oauth2/authorization/github`); | ||
}; | ||
|
||
return ( | ||
<Button | ||
icon={githubLogoIcon} | ||
style={{ backgroundColor: `${color.github}` }} | ||
onClick={handleClickLogin} | ||
> | ||
GitHub 로그인 | ||
</Button> | ||
); | ||
}; | ||
|
||
export default LoginButton; | ||
|
||
const githubLogoIcon = ( | ||
<Image | ||
alt="github-logo" | ||
height={18} | ||
src="/images/github-logo.svg" | ||
width={18} | ||
/> | ||
); |
Oops, something went wrong.