joe1chen / nodebb-plugin-sso-linkedin-oauth2

MIT License
1 stars 5 forks source link

LinkedIn users with a comma in their names raises and error #4

Open christancho opened 7 years ago

christancho commented 7 years ago

When a user with commas (as far as I can see) tries to use the LinkedIn integration, the login process fails:

15/10 00:35:55 [10434] - error: /auth/linkedin/callback Error: [[error:invalid-username, John Smith, PMP, CSM]] at userNameValid (/root/nodebb/src/user/create.js:155:78) at /root/nodebb/node_modules/async/dist/async.js:3853:24 at replenish (/root/nodebb/node_modules/async/dist/async.js:946:17) at iterateeCallback (/root/nodebb/node_modules/async/dist/async.js:931:17) at /root/nodebb/node_modules/async/dist/async.js:906:16 at /root/nodebb/node_modules/async/dist/async.js:3858:13 at emailValid (/root/nodebb/src/user/create.js:149:6) at /root/nodebb/node_modules/async/dist/async.js:3853:24 at replenish (/root/nodebb/node_modules/async/dist/async.js:946:17) at /root/nodebb/node_modules/async/dist/async.js:950:9 at eachOfLimit (/root/nodebb/node_modules/async/dist/async.js:975:24) at /root/nodebb/node_modules/async/dist/async.js:980:16 at eachOf (/root/nodebb/node_modules/async/dist/async.js:1051:5) at _parallel (/root/nodebb/node_modules/async/dist/async.js:3852:5) at Object.parallelLimit [as parallel] (/root/nodebb/node_modules/async/dist/async.js:3935:5) at Object.User.isDataValid (/root/nodebb/src/user/create.js:146:9) at async.waterfall.userData.username (/root/nodebb/src/user/create.js:24:10) at nextTask (/root/nodebb/node_modules/async/dist/async.js:5297:14) at Object.waterfall (/root/nodebb/node_modules/async/dist/async.js:5307:5) at Object.User.create (/root/nodebb/src/user/create.js:22:9) at /root/nodebb/node_modules/nodebb-plugin-sso-linkedin-oauth2/library.js:126:12 at /root/nodebb/src/database/mongo/sorted.js:248:4

Users with no commas work just fine.

Can you help us with a quick fix? We really appreciate it. Thanks! Chris