mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
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:
@@ -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')] });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user