diff --git a/backend/src/middleware/validation/validationMiddleware.js b/backend/src/middleware/validation/validationMiddleware.js index 8caf73e0c..948e1a73a 100644 --- a/backend/src/middleware/validation/validationMiddleware.js +++ b/backend/src/middleware/validation/validationMiddleware.js @@ -129,10 +129,9 @@ export const validateNotifyUsers = async (label, reason) => { const validateUpdateUser = async (resolve, root, params, context, info) => { const { name } = params - if (typeof name === 'string' && name.trim().length > USERNAME_MIN_LENGTH) - return resolve(root, params, context, info) - if (typeof name !== 'string' || name.trim().length < USERNAME_MIN_LENGTH) + if (typeof name === 'string' && name.trim().length < USERNAME_MIN_LENGTH) throw new UserInputError(`Username must be at least ${USERNAME_MIN_LENGTH} character long!`) + return resolve(root, params, context, info) } export default { diff --git a/webapp/components/Embed/EmbedComponent.vue b/webapp/components/Embed/EmbedComponent.vue index 0ce33682c..f1790304e 100644 --- a/webapp/components/Embed/EmbedComponent.vue +++ b/webapp/components/Embed/EmbedComponent.vue @@ -132,7 +132,6 @@ export default { mutation: updateUserMutation(), variables: { id: this.currentUser.id, - name: this.currentUser.name, allowEmbedIframes, }, update: (store, { data: { UpdateUser } }) => { diff --git a/webapp/components/LocaleSwitch/LocaleSwitch.vue b/webapp/components/LocaleSwitch/LocaleSwitch.vue index 156af4cb0..075e28579 100644 --- a/webapp/components/LocaleSwitch/LocaleSwitch.vue +++ b/webapp/components/LocaleSwitch/LocaleSwitch.vue @@ -90,7 +90,6 @@ export default { mutation: updateUserMutation(), variables: { id: this.currentUser.id, - name: this.currentUser.name, locale: this.$i18n.locale(), }, update: (store, { data: { UpdateUser } }) => { diff --git a/webapp/components/Upload/index.vue b/webapp/components/Upload/index.vue index 3b2106971..66e7203cc 100644 --- a/webapp/components/Upload/index.vue +++ b/webapp/components/Upload/index.vue @@ -66,7 +66,6 @@ export default { variables: { avatarUpload, id: this.user.id, - name: this.user.name, }, }) .then(() => { diff --git a/webapp/pages/settings/embeds.vue b/webapp/pages/settings/embeds.vue index 516a36262..d842dbef0 100644 --- a/webapp/pages/settings/embeds.vue +++ b/webapp/pages/settings/embeds.vue @@ -72,7 +72,6 @@ export default { mutation: updateUserMutation(), variables: { id: this.currentUser.id, - name: this.currentUser.name, allowEmbedIframes: !this.disabled, }, update: (store, { data: { UpdateUser } }) => { diff --git a/webapp/pages/settings/privacy.vue b/webapp/pages/settings/privacy.vue index 8a60f28df..3decdefbe 100644 --- a/webapp/pages/settings/privacy.vue +++ b/webapp/pages/settings/privacy.vue @@ -39,7 +39,6 @@ export default { mutation: updateUserMutation(), variables: { id: this.currentUser.id, - name: this.currentUser.name, showShoutsPublicly: this.shoutsAllowed, }, update: (_, { data: { UpdateUser } }) => { diff --git a/webapp/pages/terms-and-conditions-confirm.vue b/webapp/pages/terms-and-conditions-confirm.vue index 9a0c89821..24af8a23d 100644 --- a/webapp/pages/terms-and-conditions-confirm.vue +++ b/webapp/pages/terms-and-conditions-confirm.vue @@ -70,7 +70,6 @@ export default { mutation: updateUserMutation(), variables: { id: this.currentUser.id, - name: this.currentUser.name, termsAndConditionsAgreedVersion: VERSION, }, update: (store, { data: { UpdateUser } }) => {