diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..735e28f --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +CLIENT_SECRET= \ No newline at end of file diff --git a/server.js b/server.js index 3656424..d05c71a 100644 --- a/server.js +++ b/server.js @@ -53,7 +53,7 @@ async function refreshAccessToken() { }, body: new URLSearchParams({ client_id: "16435018183-9a880bertda0en85387ge8f8mgsves71.apps.googleusercontent.com", - client_secret: "YOUR_CLIENT_SECRET", // 실제 클라이언트 시크릿으로 변경 필요 + client_secret: process.env.CLIENT_SECRET, // 실제 클라이언트 시크릿으로 변경 필요 refresh_token: tokenStorage.refreshToken, grant_type: 'refresh_token' }) @@ -78,7 +78,7 @@ async function refreshAccessToken() { } app.get("/", (req, res) => { - const clientId = "16435018183-9a880bertda0en85387ge8f8mgsves71.apps.googleusercontent.com"; // 반드시 수정 + const clientId = "16435018183-9a880bertda0en85387ge8f8mgsves71.apps.googleusercontent.com"; // 반드시 수정 const redirectUri = "https://google-oauth-access-token-whs.hako.li/callback"; const authUrl = "https://accounts.google.com/o/oauth2/v2/auth?" +