클라이언트 시크릿을 환경 변수로 변경
This commit is contained in:
parent
05cf57df86
commit
e5696aeb19
1 changed files with 2 additions and 2 deletions
|
|
@ -98,7 +98,7 @@ app.get("/exchange", async (req, res) => {
|
||||||
if (!code) {
|
if (!code) {
|
||||||
return res.status(400).send("Authorization code가 필요합니다.");
|
return res.status(400).send("Authorization code가 필요합니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch('https://oauth2.googleapis.com/token', {
|
const response = await fetch('https://oauth2.googleapis.com/token', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
|
@ -107,7 +107,7 @@ app.get("/exchange", async (req, res) => {
|
||||||
},
|
},
|
||||||
body: new URLSearchParams({
|
body: new URLSearchParams({
|
||||||
client_id: "16435018183-9a880bertda0en85387ge8f8mgsves71.apps.googleusercontent.com",
|
client_id: "16435018183-9a880bertda0en85387ge8f8mgsves71.apps.googleusercontent.com",
|
||||||
client_secret: "YOUR_CLIENT_SECRET", // 실제 클라이언트 시크릿으로 변경 필요
|
client_secret: process.env.CLIENT_SECRET, // 실제 클라이언트 시크릿으로 변경 필요
|
||||||
code: code,
|
code: code,
|
||||||
grant_type: 'authorization_code',
|
grant_type: 'authorization_code',
|
||||||
redirect_uri: "https://google-oauth-access-token-whs.hako.li/callback"
|
redirect_uri: "https://google-oauth-access-token-whs.hako.li/callback"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue