Skip to content

Commit

Permalink
Merge pull request #384 from prgrms-web-devcourse-final-project/deploy/
Browse files Browse the repository at this point in the history
…#375

test: PWA Builder 주소 표시줄 테스트
  • Loading branch information
JW-Ahn0 authored Dec 20, 2024
2 parents 1650357 + f43275f commit af0bde0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/services/apis/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@ import type { IAuthData, IAuthResponse, OAuthProvider } from "types";

const redirectUrl: string = `${import.meta.env.VITE_CLIENT_URL}/login/callback`;
const authorizeUrl: Record<OAuthProvider, string> = {
KAKAO: `https://kauth.kakao.com/oauth/authorize?response_type=code&client_id=${import.meta.env.VITE_OAUTH_KAKAO_KEY}&redirect_uri=${redirectUrl}/kakao`,
NAVER: `https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=${import.meta.env.VITE_OAUTH_NAVER_KEY}&redirect_uri=${redirectUrl}/naver`,
KAKAO: `https://kauth.kakao.com/oauth/authorize?response_type=code&client_id=${
import.meta.env.VITE_OAUTH_KAKAO_KEY
}&redirect_uri=${redirectUrl}/kakao`,
NAVER: `https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=${
import.meta.env.VITE_OAUTH_NAVER_KEY
}&redirect_uri=${redirectUrl}/naver`,
};

/**
* provider의 authorize 페이지로 이동하는 함수
* @param provider
*/
export const requestOAuthLogin = (provider: OAuthProvider) => {
location.href = authorizeUrl[provider];
//location.href = authorizeUrl[provider];
window.open(authorizeUrl[provider], "_blank");
};

/**
Expand Down

0 comments on commit af0bde0

Please sign in to comment.