PR to fix: Disallow line breaks in display names (#12380)

* Update settings.json

* Update index.js

* Update validation.js

* Update validation.js

* Update validation.js

Removes the second check

* Update tests and validation

Added tests, and updated validation
This commit is contained in:
Amber
2020-07-18 15:41:19 -05:00
committed by GitHub
parent e550ca1531
commit ead0b6c56f
5 changed files with 22 additions and 1 deletions

View File

@@ -53,5 +53,11 @@ describe('POST /user/auth/verify-display-name', async () => {
displayName: 'this is a very long display name over 30 characters',
})).to.eventually.eql({ isUsable: false, issues: [t('displaynameIssueLength')] });
});
it('errors if display name contains a newline', async () => {
await expect(user.post(ENDPOINT, {
displayName: 'namecontainsnewline\n',
})).to.eventually.eql({ isUsable: false, issues: [t('displaynameIssueNewline')] });
});
});
});