Skip to content

Commit

Permalink
Feat: BE 네이버 로그인 기능 구현 (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
DingX2 authored Feb 13, 2024
1 parent 8a6c116 commit 17d0011
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frontend/src/components/auth/NaverLoginButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ const CLIENT_ID_2 = import.meta.env.VITE_APP_CLIENT_ID_2;
export const NaverLoginButton = () => {
const naverRef = useRef()
const { naver } = window
const REDIRECT_URI = "http://localhost:5173/signupnaver";
const REDIRECT_URI = "http://localhost:5173/signupnaver"

const STATE = "flase";
const NAVER_AUTH_URL = `https://nid.naver.com/oauth2.0/authorize?client_id=${CLIENT_ID}&response_type=code&redirect_uri=${REDIRECT_URI}&state=${STATE}`;
const NAVER_AUTH_LOGIN = `http://localhost:8001/oauth2/authorization/naver`

const NaverLogin = () => {
window.location.href = NAVER_AUTH_URL;
window.location.href = NAVER_AUTH_LOGIN;
}

const initializeNaverLogin = () => {
const naverLogin = new naver.LoginWithNaverId({
clientId: CLIENT_ID_2,
callbackUrl: REDIRECT_URI,
callbackUrl: NAVER_AUTH_LOGIN,
isPopup: false,
loginButton: { color: 'green', type: 3, height: 58 },
callbackHandle: true,
Expand Down Expand Up @@ -74,7 +75,7 @@ export const NaverLoginButton = () => {
<rect x="2.51801" y="1.81" width="3.62" height="15.4" transform="rotate(-30 2.51801 1.81)" fill="white"/>
</svg>
</div>
<span className="text">BE에게 전달 가입</span>
<span className="text">네이버 간편 가입</span>
</div>
</div>
</NaverButtonStyles>
Expand Down

0 comments on commit 17d0011

Please sign in to comment.