Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature-059: 소셜 로그인 임시 조치 #43

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ProfilePage from '@/pages/ProfilePage';
import SearchPage from '@/pages/SearchPage';
import SignInPage from '@/pages/SignInPage';
import SignUpPage from '@/pages/SignUpPage';
import SignUpSuccessPage from '@/pages/SignUpSuccessPage';
import SummaryPage from '@/pages/SummaryPage';

// Layouts
Expand All @@ -40,6 +41,7 @@ const App = () => {
<>
<Route path="/sign-in" element={<SignInPage />} />
<Route path="/sign-up" element={<SignUpPage />} />
<Route path="/sign-up/success" element={<SignUpSuccessPage />} />
<Route path="/find-email" element={<FindEmailPage />} />
<Route path="/find-password" element={<FindPasswordPage />} />
</>
Expand Down
14 changes: 3 additions & 11 deletions src/pages/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ const SignInPage: React.FC = () => {
}
};

const Rest_api_key = '77ddf1baeb87f4a9752ed437db43cd96'; //kakao REST API KEY
const redirect_uri = 'https://localhost:5173/sign-up-suc'; //Redirect URI
const redirect_uri = `${location.origin}/sign-up/success`; //Redirect URI
const KAKAO_KEY = '77ddf1baeb87f4a9752ed437db43cd96'; //kakao REST API KEY
const NAVER_CLIENT_ID = 'qR4Npp1ui69SCF6nAJd2';
const STATE = 'flase';
// oauth 요청 URL
const kakaoURL = `https://kauth.kakao.com/oauth/authorize?client_id=${Rest_api_key}&redirect_uri=${redirect_uri}&response_type=code`;
const kakaoURL = `https://kauth.kakao.com/oauth/authorize?client_id=${KAKAO_KEY}&redirect_uri=${redirect_uri}&response_type=code`;
const naverURL = `https://nid.naver.com/oauth2.0/authorize?response_type=code&client_id=${NAVER_CLIENT_ID}&state=${STATE}&redirect_uri=${redirect_uri}`;

const handleKakaoLogin = () => {
Expand All @@ -95,14 +95,6 @@ const SignInPage: React.FC = () => {
window.location.href = naverURL;
};

/* let login:any = new window.naver.LoginWithNaverId("http://localhost:5173/sign-in/", "http://localhost:5173/sign-in");
let state = login.getUniqState();
login.setButton("white", 2,40);
login.setDomain(".service.com");
login.setState(state);
login.isPopup(false);
login.LoginWithNaverId(); */

return (
<PageComponent>
<LoginTotalComponent>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/SignUpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ const SignUp: React.FC<SignUpProps> = () => {
// 서버에 데이터 전송
onRegisterUserInfo();
console.log('정보 등록 완료');
navigate('/sign-up-suc');
navigate('/sign-up/success');
} else {
alert('입력값을 확인해주세요.');
}
Expand Down
49 changes: 23 additions & 26 deletions src/pages/SignUpSuccessPage.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,28 @@
import styled from 'styled-components';
import celebrate from "../assets/celebrate.png";
import celebrate from '../assets/celebrate.png';
import { useNavigate } from 'react-router-dom';

const SignUpSuccessPage = () => {

const navigate = useNavigate();
const navigateToHome = () => {
const navigate = useNavigate();
const navigateToHome = () => {
navigate('/');
};
};

return(
return (
<Wrapper>
<img src={celebrate} alt="축하 이미지" />
<h4>
회원가입이 완료되었어요!
</h4>
<p>로그인하고 나만의 영상 아카이빙을 시작해요</p>
<HomeButton type="submit" onClick={navigateToHome}>
영상 읽으러가기
</HomeButton>
<img src={celebrate} alt="축하 이미지" />
<h4>회원가입이 완료되었어요!</h4>
<p>로그인하고 나만의 영상 아카이빙을 시작해요</p>
<HomeButton type="submit" onClick={navigateToHome}>
영상 읽으러가기
</HomeButton>
</Wrapper>
);
};

export default SignUpSuccessPage;
);
};

const Wrapper = styled.div`
export default SignUpSuccessPage;

const Wrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
Expand All @@ -34,7 +31,7 @@ return(
width: 100%;
min-height: 100vh;
h4 {
color:#1E1E1E;
color: #1e1e1e;
font-size: 32px;
font-weight: 500;
line-height: 160%;
Expand All @@ -46,13 +43,13 @@ return(
font-weight: bold;
}
}
img{
img {
display: flex;
width: 130.67px;
height: 121.67px;
}
p{
color:#BBBBBB;
p {
color: #bbbbbb;
font-size: 16px;
font-weight: 500;
line-height: 160%;
Expand All @@ -64,15 +61,15 @@ const HomeButton = styled.button`
width: 494px;
height: 56px;
background: #1e1e1e;
color: #FFFFFF;
color: #ffffff;
font-size: 16px;
font-weight: 500;
line-height: 160%;
border-radius: 12px;
border: none;
margin-top:64px;
margin-top: 64px;
font-family: Pretendard;
&:hover {
cursor: pointer;
}
`;
`;
Loading