-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gmmq 157 feat: 로그인 페이지 마크업 + 카카오 로그인 페이지 리다이렉션 (#6)
* chore: meta title 수정 * feat: 카카오 소셜 로그인 key, redirect uri 환경변수 추가 * feat: 로그인 페이지 마크업 + 카카오 로그인 페이지 리다이렉션 * feat: 로그인 페이지 마크업 추가 * GMMQ-79 feat: axios interceptor (#4) * feat: baseUrl env 상수 추가, gitignore * feat: axios 인스턴스 추가 * feat: 401, 404, 5xx axios 인터셉터 추가 * Gmmq 72 feat: 라우터 설정하기 (#2) * feat: 라우터 적용을 위한 페이지 생성 * feat: 레이아웃 생성 * feat: 라우터 설정 * chore: index 파일 수정 * feat: Page 폴더 구조 정리 * feat: 라우터 설정 * chore: 사용하지 않는 파일 제거 * fix: 경로 수정 * chore: index 파일 삭제 * fix: 라우팅 변경, 파일 이름 변경 * fix: 환경변수 prefix 수정 --------- Co-authored-by: backward99 <86753969+backward99@users.noreply.github.com> * fix: base url 환경변수 이동 --------- Co-authored-by: backward99 <86753969+backward99@users.noreply.github.com>
- Loading branch information
1 parent
b297e80
commit b4d6b52
Showing
5 changed files
with
47 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { VITE_BASE_URL, VITE_KAKAO_REST_API_KEY, VITE_KAKAO_REDIRECT_URI } = import.meta.env; | ||
|
||
export const environments = { | ||
baseUrlEnv: () => checkEnv(VITE_BASE_URL), | ||
kakaoRestApiKeyEnv: () => checkEnv(VITE_KAKAO_REST_API_KEY), | ||
kakaoRedirectUriEnv: () => checkEnv(VITE_KAKAO_REDIRECT_URI), | ||
}; | ||
|
||
const checkEnv = (envKey: string) => { | ||
if (!envKey) { | ||
throw new Error(`${envKey} 환경변수가 설정돼있지 않습니다.`); | ||
} | ||
return envKey; | ||
}; |
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,7 +1,3 @@ | ||
import { environments } from './environments'; | ||
|
||
const constants = { | ||
...environments, | ||
}; | ||
const constants = {}; | ||
|
||
export default constants; |
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,20 @@ | ||
import { environments } from '~/config/environments'; | ||
|
||
const SignInPage = () => { | ||
return <></>; | ||
const kakaoSignInUrl = `https://kauth.kakao.com/oauth/authorize?client_id=${environments.kakaoRestApiKeyEnv()}&redirect_uri=${environments.kakaoRedirectUriEnv()}&response_type=code`; | ||
const handleKakaoClick = () => { | ||
window.location.href = kakaoSignInUrl; | ||
}; | ||
return ( | ||
<div> | ||
<div>resume.me</div> | ||
<div>이력,써에 가입하고 피드백을 받아보세요.</div> | ||
<div>연동할 소셜 서비스 계정을 선택하세요.</div> | ||
<button onClick={handleKakaoClick}>카카오 로그인</button> | ||
<a href="#">계정을 잊으셨나요?</a> | ||
<div>ⓒ 아몬드빼빼로</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SignInPage; |