클라이언트 시크릿을 환경 변수로 변경

This commit is contained in:
암냥 2025-07-05 13:25:08 +09:00
commit e5696aeb19

View file

@ -98,7 +98,7 @@ app.get("/exchange", async (req, res) => {
if (!code) {
return res.status(400).send("Authorization code가 필요합니다.");
}
try {
const response = await fetch('https://oauth2.googleapis.com/token', {
method: 'POST',
@ -107,7 +107,7 @@ app.get("/exchange", async (req, res) => {
},
body: new URLSearchParams({
client_id: "16435018183-9a880bertda0en85387ge8f8mgsves71.apps.googleusercontent.com",
client_secret: "YOUR_CLIENT_SECRET", // 실제 클라이언트 시크릿으로 변경 필요
client_secret: process.env.CLIENT_SECRET, // 실제 클라이언트 시크릿으로 변경 필요
code: code,
grant_type: 'authorization_code',
redirect_uri: "https://google-oauth-access-token-whs.hako.li/callback"