diff --git a/firebase-debug.log b/firebase-debug.log deleted file mode 100644 index d4d7787..0000000 --- a/firebase-debug.log +++ /dev/null @@ -1,17 +0,0 @@ -[debug] [2020-05-15T17:40:27.032Z] ---------------------------------------------------------------------- -[debug] [2020-05-15T17:40:27.034Z] Command: /usr/local/bin/node /usr/local/bin/firebase deploy -[debug] [2020-05-15T17:40:27.035Z] CLI Version: 8.2.0 -[debug] [2020-05-15T17:40:27.035Z] Platform: darwin -[debug] [2020-05-15T17:40:27.035Z] Node Version: v12.16.2 -[debug] [2020-05-15T17:40:27.038Z] Time: Fri May 15 2020 18:40:27 GMT+0100 (British Summer Time) -[debug] [2020-05-15T17:40:27.038Z] ---------------------------------------------------------------------- -[debug] [2020-05-15T17:40:27.039Z] -[debug] [2020-05-15T17:40:27.052Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"] -[debug] [2020-05-15T17:40:27.053Z] > authorizing via signed-in user -[debug] [2020-05-15T17:40:27.053Z] [iam] checking project project-gg-3b754 for permissions ["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get","firebasehosting.sites.update"] -[debug] [2020-05-15T17:40:27.055Z] > refreshing access token with scopes: ["email","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","openid"] -[debug] [2020-05-15T17:40:27.055Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token - -[debug] [2020-05-15T17:40:27.266Z] <<< HTTP RESPONSE 200 {"content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","date":"Fri, 15 May 2020 17:40:28 GMT","server":"scaffolding on HTTPServer2","cache-control":"private","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-27=\":443\"; ma=2592000,h3-25=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q049=\":443\"; ma=2592000,h3-Q048=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"","accept-ranges":"none","transfer-encoding":"chunked"} -[debug] [2020-05-15T17:40:27.282Z] >>> HTTP REQUEST POST https://cloudresourcemanager.googleapis.com/v1/projects/project-gg-3b754:testIamPermissions - {"permissions":["cloudfunctions.functions.create","cloudfunctions.functions.delete","cloudfunctions.functions.get","cloudfunctions.functions.list","cloudfunctions.functions.update","cloudfunctions.operations.get","firebase.projects.get","firebasehosting.sites.update"]} diff --git a/functions/index.js b/functions/index.js index ab6f54b..8855d33 100644 --- a/functions/index.js +++ b/functions/index.js @@ -426,7 +426,7 @@ app.post('/shipping-adress-edit-api', function(request, responce){ } }) -app.post('/new-product-api', function(request, responce){ +app.post('/new-product-api', async function(request, responce){ if (request.body.uToken && request.body.product && request.body.image) { let uid = await authCheck(request.body.authToken) if (uid) { diff --git a/server.js b/server.js index 3e74165..c521a73 100644 --- a/server.js +++ b/server.js @@ -424,7 +424,7 @@ app.post('/shipping-adress-edit-api', function(request, responce){ } }) -app.post('/new-product-api', function(request, responce){ +app.post('/new-product-api', async function(request, responce){ if (request.body.uToken && request.body.product && request.body.image) { let uid = await authCheck(request.body.authToken) if (uid) {