-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
소셜로그인 기능을 pull 한 후 충돌 해결 Issues #19
- Loading branch information
Showing
34 changed files
with
1,328 additions
and
341 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,21 @@ | ||
// GoogleLoginButton.tsx | ||
|
||
import React from 'react'; | ||
|
||
interface Props { | ||
backendURL: string; | ||
} | ||
|
||
const GoogleLoginButton: React.FC<Props> = ({ backendURL }) => { | ||
const handleLoginClick = () => { | ||
window.location.href = `${backendURL}`; | ||
}; | ||
|
||
return ( | ||
<button onClick={handleLoginClick}> | ||
Login with Google | ||
</button> | ||
); | ||
} | ||
|
||
export default GoogleLoginButton; |
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,21 @@ | ||
// KakaoLoginButton.tsx | ||
|
||
import React from 'react'; | ||
|
||
interface Props { | ||
backendURL: string; | ||
} | ||
|
||
const KakaoLoginButton: React.FC<Props> = ({ backendURL }) => { | ||
const handleLoginClick = () => { | ||
window.location.href = `${backendURL}`; | ||
}; | ||
|
||
return ( | ||
<button onClick={handleLoginClick}> | ||
Login with Kakao | ||
</button> | ||
); | ||
} | ||
|
||
export default KakaoLoginButton; |
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,28 @@ | ||
// TokenHandler.tsx | ||
|
||
import React, { useEffect } from 'react'; | ||
import { useDispatch } from "react-redux"; | ||
import { useNavigate } from 'react-router-dom'; | ||
import { setLoginState } from "../../reducer/member/loginSlice"; | ||
|
||
const TokenHandler: React.FC = () => { | ||
const dispatch = useDispatch(); | ||
const navigate = useNavigate(); | ||
|
||
useEffect(() => { | ||
const urlParams = new URLSearchParams(window.location.search); | ||
const accessToken = urlParams.get("access_token"); | ||
const refreshToken = urlParams.get("refresh_token"); | ||
|
||
if (accessToken && refreshToken) { | ||
localStorage.setItem("Authorization", `Bearer ${accessToken}`); | ||
localStorage.setItem("Refresh-token", refreshToken); | ||
dispatch(setLoginState()); | ||
navigate('/'); | ||
} | ||
}, [dispatch, navigate]); | ||
|
||
return null; // 이 컴포넌트는 UI를 렌더링하지 않습니다. | ||
}; | ||
|
||
export default TokenHandler; |
Oops, something went wrong.