NodeBB / nodebb-plugin-sso-oauth2-multiple

NodeBB Plugin for configuring multiple OAuth2 endpoints for login
BSD 2-Clause "Simplified" License
9 stars 4 forks source link

uncaught exception #13

Closed barisusakli closed 1 year ago

barisusakli commented 1 year ago

2023-08-24T19:08:18.191Z [4567/2759461] - error: Error: Invalid Username at User.isDataValid (/home/ec2-user/nodebb/nodebb/src/user/create.js:145:10) at Object.wrapperCallback [as isDataValid] (/home/ec2-user/nodebb/nodebb/src/promisify.js:46:11) at User.create (/home/ec2-user/nodebb/nodebb/src/user/create.js:22:14) at Object.wrapperCallback [as create] (/home/ec2-user/nodebb/nodebb/src/promisify.js:46:11) at Object.OAuth.login (/home/ec2-user/nodebb/nodebb/node_modules/nodebb-plugin-sso-oauth2-multiple/library.js:173:20) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async OAuth2Strategy._verify (/home/ec2-user/nodebb/nodebb/node_modules/nodebb-plugin-sso-oauth2-multiple/library.js:86:16) 2023-08-24T19:08:18.191Z [4567/2759461] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised. 2023-08-24T19:08:18.194Z [4567/2759461] - info: [app] Web server closed to connections. 2023-08-24T19:08:18.197Z [4567/2759461] - info: [app] Live analytics saved. 2023-08-24T19:08:18.200Z [4567/2759461] - info: [app] Database connection closed. 2023-08-24T19:08:18.200Z [4567/2759461] - info: [app] Shutdown complete. [cluster] Child Process (2759461) has exited (code: 1, signal: null)

barisusakli commented 1 year ago

https://github.com/NodeBB/nodebb-plugin-sso-oauth2-multiple/commit/2477a3032acf9c8789e4315d939d8123d23e68b0

julianlam commented 1 year ago

The missing awaits were actually on purpose since nothing depended on them, so done() would be called a little sooner, but it doesn't really matter either way :smile:

As for the try..catch, that's a good fix. I wonder whether we should handle it for the user instead? e.g. slugify username instead.