[user] disallow ending profile name with a dot

This commit is contained in:
Avris 2021-12-07 12:28:36 +01:00
parent f1080a847f
commit 10033905cf
1 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,10 @@ const isSpam = (email) => {
|| email.length > 128;
}
const replaceExtension = username => username.replace(/\.(txt|jpg|jpeg|png|pdf|gif|doc|docx|csv|js|css)$/i, '_$1');
const replaceExtension = username => username
.replace(/\.(txt|jpg|jpeg|png|pdf|gif|doc|docx|csv|js|css|html)$/i, '_$1')
.replace(/\.$/, '')
;
const saveAuthenticator = async (db, type, user, payload, validForMinutes = null) => {
const id = ulid();