-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Check settings for name requirement before validating #14021
Conversation
app/lib/server/functions/saveUser.js
Outdated
@@ -171,6 +171,11 @@ export const saveUser = function(userId, userData) { | |||
|
|||
const _id = Accounts.createUser(createUser); | |||
|
|||
// set userData.name to empty string to guarantee it's not undefined | |||
if (!userData.name) { | |||
userData.name = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not? That way if I as admin edit a user that doesn't have a name name === undefined
I'll update it to name === ''
and all of his subscriptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and how would you clear the username after it's been set to something?
… into emoji-upgrades * 'emoji-upgrades' of https://github.com/wreiske/Rocket.Chat: Settings: disable reset button (RocketChat#14026) Settings: hiding reset button for readonly fields (RocketChat#14025) [NEW] Add support to updatedSince parameter in emoji-custom.list and deprecated old endpoint (RocketChat#13510) [IMPROVE] Add permission to change other user profile avatar (RocketChat#13884) [IMPROVE] UI of Permissions page (RocketChat#13732) [NEW] Chatpal: Enable custom search parameters (RocketChat#13828) (RocketChat#13829) [FIX] Closing sidebar when room menu is clicked. (RocketChat#13842) [FIX] Check settings for name requirement before validating (RocketChat#14021) Fix debug logging not being enabled by the setting (RocketChat#13979) [FIX] Links and upload paths when running in a subdir (RocketChat#13982)
Closes #6081
When "Require Name For Signup" in Admin -> Accounts -> Registration is set to false, allows saving user info without providing a name, and also allows setting it to empty.