caffeines / File-Cloud

Online File Sharing web app
6 stars 3 forks source link

Google OAuth2? #4

Open mzch opened 4 years ago

mzch commented 4 years ago

Hi,

I setup File-Cloud and tried to sign up, then File-Cloud aborted.

Nov 30 11:27:10 lo node[7855]: (node:7855) DeprecationWarning: collection.findAndModify is deprecated. Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead.
Nov 30 11:27:12 lo node[7855]: /srv/filecloud/File-Cloud/File-Cloud/routes/home/main.js:214
Nov 30 11:27:12 lo node[7855]:                     throw error;
Nov 30 11:27:12 lo node[7855]:                     ^
Nov 30 11:27:12 lo node[7855]: Error: Invalid status code 400
Nov 30 11:27:12 lo node[7855]:     at ClientRequest.<anonymous> (/srv/filecloud/File-Cloud/File-Cloud/node_modules/nodemailer/lib/fetch/index.js:221:23)
Nov 30 11:27:12 lo node[7855]:     at ClientRequest.emit (events.js:210:5)
Nov 30 11:27:12 lo node[7855]:     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
Nov 30 11:27:12 lo node[7855]:     at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
Nov 30 11:27:12 lo node[7855]:     at TLSSocket.socketOnData (_http_client.js:456:22)
Nov 30 11:27:12 lo node[7855]:     at TLSSocket.emit (events.js:210:5)
Nov 30 11:27:12 lo node[7855]:     at addChunk (_stream_readable.js:309:12)
Nov 30 11:27:12 lo node[7855]:     at readableAddChunk (_stream_readable.js:290:11)
Nov 30 11:27:12 lo node[7855]:     at TLSSocket.Readable.push (_stream_readable.js:224:10)
Nov 30 11:27:12 lo node[7855]:     at TLSWrap.onStreamRead (internal/stream_base_commons.js:182:23) {
Nov 30 11:27:12 lo node[7855]:   type: 'FETCH',
Nov 30 11:27:12 lo node[7855]:   sourceUrl: 'https://accounts.google.com/o/oauth2/token',
Nov 30 11:27:12 lo node[7855]:   code: 'EAUTH',
Nov 30 11:27:12 lo node[7855]:   command: 'AUTH XOAUTH2'
Nov 30 11:27:12 lo node[7855]: }
Nov 30 11:27:12 lo systemd[1]: file-cloud.service: Main process exited, code=exited, status=1/FAILURE
Nov 30 11:27:12 lo systemd[1]: file-cloud.service: Failed with result 'exit-code'.

Could you tell me how to fix this issue?

mzch commented 4 years ago

I found a cause. In routes/home/main.js Google account is hard-coded. I rewrote this to proper credentials, File-Cloud works well.