mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Remove check for setting name to null or undefined
- this was making things more likely to fail from the frontend, we would need to consider doing a db manipulation for users from the old alpha who have user.name as null. - it only protects against someone who bypasses our UI and sends a message directly to the backend, but if they can do that we have bigger problems.
This commit is contained in:
parent
fd1e2c91fd
commit
dfd30cbaac
@ -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 {
|
||||
|
||||
@ -132,7 +132,6 @@ export default {
|
||||
mutation: updateUserMutation(),
|
||||
variables: {
|
||||
id: this.currentUser.id,
|
||||
name: this.currentUser.name,
|
||||
allowEmbedIframes,
|
||||
},
|
||||
update: (store, { data: { UpdateUser } }) => {
|
||||
|
||||
@ -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 } }) => {
|
||||
|
||||
@ -66,7 +66,6 @@ export default {
|
||||
variables: {
|
||||
avatarUpload,
|
||||
id: this.user.id,
|
||||
name: this.user.name,
|
||||
},
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
@ -72,7 +72,6 @@ export default {
|
||||
mutation: updateUserMutation(),
|
||||
variables: {
|
||||
id: this.currentUser.id,
|
||||
name: this.currentUser.name,
|
||||
allowEmbedIframes: !this.disabled,
|
||||
},
|
||||
update: (store, { data: { UpdateUser } }) => {
|
||||
|
||||
@ -39,7 +39,6 @@ export default {
|
||||
mutation: updateUserMutation(),
|
||||
variables: {
|
||||
id: this.currentUser.id,
|
||||
name: this.currentUser.name,
|
||||
showShoutsPublicly: this.shoutsAllowed,
|
||||
},
|
||||
update: (_, { data: { UpdateUser } }) => {
|
||||
|
||||
@ -70,7 +70,6 @@ export default {
|
||||
mutation: updateUserMutation(),
|
||||
variables: {
|
||||
id: this.currentUser.id,
|
||||
name: this.currentUser.name,
|
||||
termsAndConditionsAgreedVersion: VERSION,
|
||||
},
|
||||
update: (store, { data: { UpdateUser } }) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user