Skip to content

Commit d1843fd

Browse files
authored
Merge pull request #18 from DguFarmSystem/fix/#16
fix: 환경별 리다이렉트 url 변경
2 parents af4e6e4 + e5d12de commit d1843fd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/hooks/useSocialLogin.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ declare global {
1515
}
1616

1717
// 환경별 리다이렉트 URI 가져오기
18-
const getRedirectUri = () => {
19-
return import.meta.env.MODE === "development"
20-
? "http://localhost:5173/api/auth/login" // 로컬 환경
21-
: "https://api.dev.farmsystem.kr/api/auth/login"; // 개발 서버 환경
18+
const getRedirectUri = (provider: "KAKAO" | "GOOGLE") => {
19+
return provider === "KAKAO"
20+
? import.meta.env.VITE_KAKAO_REDIRECT_URI
21+
: import.meta.env.VITE_GOOGLE_REDIRECT_URI;
2222
};
2323

2424
// 환경 감지 (웹 vs 카카오 앱)
@@ -52,7 +52,7 @@ export const useSocialLogin = () => {
5252
}, []);
5353

5454
const handleLogin = (provider: "KAKAO" | "GOOGLE") => {
55-
const redirectUri = getRedirectUri();
55+
const redirectUri = getRedirectUri(provider);
5656
const clientId =
5757
provider === "KAKAO"
5858
? import.meta.env.VITE_KAKAO_CLIENT_ID

0 commit comments

Comments
 (0)