Skip to content

Commit

Permalink
Merge pull request #100 from KakaoTech-BootCamp-Team-2/dev
Browse files Browse the repository at this point in the history
🚀 Deploy
  • Loading branch information
sayyyho authored Sep 10, 2024
2 parents ab1c0e2 + d548479 commit 2cc5c26
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions src/pages/LoginPage.jsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
import React from "react";

import { Link } from "react-router-dom";
function LoginPage() {
const handleLogin = async () => {
try {
console.log("Attempting to redirect to OAuth provider...");

// Redirection URL 로그 추가
// const redirectUrl = `https://kauth.kakao.com/oauth/authorize?client_id=${kakaoClientId}&redirect_uri=${redirectUri}&response_type=code`;
const redirectUrl = `https://api.kaboo.site:8081/oauth2/authorization/kakao?client_id=${import.meta.env.VITE_KAKAO_CLIENT_ID}&redirect_uri=${import.meta.env.VITE_KAKAO_REDIRECT_URI}&response_type=code`;
console.log("Redirect URL:", redirectUrl);

window.location.href = redirectUrl;
// const handleLogin = async () => {
// try {

console.log(res);
} catch (error) {
console.error("Error during redirection:", error);
}
};
// // Redirection URL 로그 추가
// // const redirectUrl = `https://kauth.kakao.com/oauth/authorize?client_id=${kakaoClientId}&redirect_uri=${redirectUri}&response_type=code`;
// // const redirectUrl = `https://api.kaboo.site:8081/oauth2/authorization/kakao?client_id=${import.meta.env.VITE_KAKAO_CLIENT_ID}&redirect_uri=${import.meta.env.VITE_KAKAO_REDIRECT_URI}&response_type=code`;
// } catch (error) {
// console.error("Error during redirection:", error);
// }
// };

return (
<div>
<h2>Login Page</h2>
<button onClick={handleLogin}>Login with kakao</button>
<Link
to={`${import.meta.env.VITE_AUTH_BASE_URL}/oauth2/authorization/kakao`}
>
로그인
</Link>
<br />
<Link
to={`${import.meta.env.VITE_AUTH_BASE_URL}/oauth2/authorization/kakao?client_id=${import.meta.env.VITE_KAKAO_CLIENT_ID}&redirect_uri=${import.meta.env.VITE_KAKAO_REDIRECT_URI}&response_type=code`}
>
로그인2
</Link>
</div>
);
}
Expand Down

0 comments on commit 2cc5c26

Please sign in to comment.