trudesk icon indicating copy to clipboard operation
trudesk copied to clipboard

Username truncated to 25 characters causing inconvenience for accounts created by email

Open mrt-prodz opened this issue 2 years ago • 0 comments

Is this a BUG REPORT or FEATURE REQUEST?:

  • [ ] BUG
  • [X] FEATURE

What happened: Username and fullname is truncated to 25 characters and it is causing a small inconvenience with accounts created from email resulting in a truncated email as login.

What did you expect to happen: Login for an account created through email would be better if it was the full email.

How to reproduce it (as minimally and precisely as possible): Using an email address above 25 characters length and using Trudesk with mailcheck activated :

  • send a ticket
  • wait for Trudesk mailcheck to retrieve it, create an account and associate a ticket with it
  • account created will truncate the email making it an inconvenience for the user to remember their login

Anything else we need to know?: This might be silly to many users, but for us it's really the very last issue before deploying Trudesk internally, I know people will fail to read the account creation email properly and ask us why they can't login to see their tickets.

All our emails are in the [firstname].[lastname]@[domain].[ext] format, so going above 25 characters is quite easy.

On our environment I fear that changing :

https://github.com/polonel/trudesk/blob/5bbc42395de7d2589daa97d6837500826448ac11/src/models/user.js#L100

to

user.username = utils.applyMaxTextLength(utils.sanitizeFieldPlainText(user.username.toLowerCase().trim()))

could cause issue somewhere else, however it would successfully change username length from 25 to 255 characters.

Using grep I checked where applyMaxShortTextLength was called and models/user.js is the only place, but I'm not sure about potential UI issue. I will test it and see if username (and fullname) above this limit could break something.

I could also create a new constant / method in utils/index.js with a 64 characters limit to keep login length reasonable.

What is your opinion about this ?

Environment:

  • Trudesk Version: (Docker) polonel/trudesk:1.2.5
  • OS (e.g. from /etc/os-release): (Docker) Alpine Linux v3.15.4
  • Node.JS Version: v16.14.2
  • MongoDB Version: (Docker) mongo:5.0-focal
  • Is this hosted on cloud.trudesk.io: No

mrt-prodz avatar Aug 20 '22 09:08 mrt-prodz