Skip to content

Commit e5f7794

Browse files
committed
feat: 카카오 로그인 리다이렉션 주소 변경
1 parent 8be6bab commit e5f7794

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/api/config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const getApiBaseUrl = () => {
2+
const host = window.location.hostname;
3+
4+
if (host === 'localhost') return import.meta.env.VITE_LOCAL_API_URL;
5+
if (host === 'test.codemonster.site') return import.meta.env.VITE_TEST_URL;
6+
if (host === 'codemonster.site') return import.meta.env.VITE_BASE_URL;
7+
8+
return 'https://api.codemonster.site';
9+
};
10+
11+
export const API_BASE_URL = getApiBaseUrl();

src/api/user.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { isDevMode } from '@/utils/cookie.ts';
22

33
import apiInstance from '@/api/apiInstance';
4+
import { API_BASE_URL } from '@/api/config.ts';
45
import { membersInfoMock } from '@/api/mocks.ts';
56
import { ServerResponse } from '@/api/types';
67

7-
export const kakaoOauth2LoginUrl = `/oauth2/authorization/kakao`;
8+
export const kakaoOauth2LoginUrl = `${API_BASE_URL}/oauth2/authorization/kakao`;
89

910
type ProfileCommonArgs = {
1011
memberName: string;

0 commit comments

Comments
 (0)