fredmaiaarantes / simpletasks

Simple Tasks with Meteor 3.0 + Chakra UI + RHF + MongoDB
https://simpletasks.meteorapp.com
MIT License
44 stars 26 forks source link

When I add thirdpart login in this project, something went wrong #12

Closed zexiplus closed 3 months ago

zexiplus commented 10 months ago

When I add thirdpart login in this project, (github or what), I added service-configuration,accounts-github module and try the code eg. ServiceConfiguration.configurations.upsert( { service: 'github' }, { $set: { loginStyle: 'popup', clientId: 'balabala', secret: 'balabala', }, } );

the errors happened error on boot.js Error: update + is not available on the server. Please use updateAsync() instead. I20231218-10:57:40.518(8)? at Object.ret. [as update] (packages/mongo/remote_collection_driver.js:52:15) I20231218-10:57:40.518(8)? at Collection.update (packages/mongo/collection.js:961:31) I20231218-10:57:40.518(8)? at Collection.upsert (packages/mongo/collection.js:1066:17) I20231218-10:57:40.518(8)? at packages/service-configuration/service_configuration_server.js:38:41 I20231218-10:57:40.518(8)? at Array.forEach () I20231218-10:57:40.518(8)? at packages/service-configuration/service_configuration_server.js:37:25 I20231218-10:57:40.518(8)? at Function.time (/Users/float/Code/joi-ai/great-prompt/.meteor/local/build/programs/server/profile.js:277:30) I20231218-10:57:40.518(8)? at /Users/float/Code/joi-ai/great-prompt/.meteor/local/build/programs/server/boot.js:389:21 I20231218-10:57:40.518(8)? at processTicksAndRejections (node:internal/process/task_queues:95:5) I20231218-10:57:40.518(8)? at /Users/float/Code/joi-ai/great-prompt/.meteor/local/build/programs/server/boot.js:438:9 I20231218-10:57:40.518(8)? at startServerProcess (/Users/float/Code/joi-ai/great-prompt/.meteor/local/build/programs/server/boot.js:435:5) I20231218-10:57:40.518(8)? Error: update + is not available on the server. Please use updateAsync() instead. I20231218-10:57:40.518(8)? at Object.ret. [as update] (packages/mongo/remote_collection_driver.js:52:15) I20231218-10:57:40.519(8)? at Collection.update (packages/mongo/collection.js:961:31) I20231218-10:57:40.519(8)? at Collection.upsert (packages/mongo/collection.js:1066:17) I20231218-10:57:40.519(8)? at packages/service-configuration/service_configuration_server.js:38:41 I20231218-10:57:40.519(8)? at Array.forEach () I20231218-10:57:40.519(8)? at packages/service-configuration/service_configuration_server.js:37:25 I20231218-10:57:40.519(8)? at Function.time (/Users/float/Code/joi-ai/great-prompt/.meteor/local/build/programs/server/profile.js:277:30) I20231218-10:57:40.519(8)? at /Users/float/Code/joi-ai/great-prompt/.meteor/local/build/programs/server/boot.js:389:21 I20231218-10:57:40.519(8)? at processTicksAndRejections (node:internal/process/task_queues:95:5) I20231218-10:57:40.519(8)? at /Users/float/Code/joi-ai/great-prompt/.meteor/local/build/programs/server/boot.js:438:9 I20231218-10:57:40.519(8)? at startServerProcess (/Users/float/Code/joi-ai/great-prompt/.meteor/local/build/programs/server/boot.js:435:5) => Exited with code: 1 => Your application is crashing. Waiting for file change.

when I change ServiceConfiguration.configurations.upsert to ServiceConfiguration.configurations.upsertAsync, the error disapeared, but the code doesn't work well.

Then I realized th Meteor 2.7+ should use Meteor settings by setting your services under Meteor.settings.packages.service-configuration. eg. { "packages": { "service-configuration": { "github": { "loginStyle": "popup", "clientId": "balabala", "secret": "balabala" } } } }

when I change to that, the first error show again

what should I do when I need to add third part login in this project(meteor 3) ?

I am a newbee, plz show me the code

fredmaiaarantes commented 3 months ago

Hey @zexiplus, I just set up Login with GitHub. Instead of using code, I added the GitHub credentials in the settings.json file. You can check the instructions in the README.md and test it at https://simpletasks.meteorapp.com.