RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://rocketchat.github.io/EmbeddedChat/docs
126 stars 252 forks source link

Whitespace in Username/Email Input Prevents Login in EmbeddedChat Login Form #656

Closed SinghaAnirban005 closed 2 weeks ago

SinghaAnirban005 commented 3 weeks ago

Description:

When logging in through the EmbeddedChat form, if extra whitespaces are added to the beginning or end of the username or email, the system doesn’t trim these whitespaces. This causes the login to fail, even though the credentials are otherwise correct.

Steps to reproduce:

  1. Go to the EmbeddedChat login form.
  2. Enter a valid username or email, but include leading or trailing whitespaces.
  3. Attempt to log in.

https://github.com/user-attachments/assets/1b9af213-686f-49b7-8945-a04624846140

From the above video it is clear that password's allow whitespaces along with text but the same is not allowed with username or email so i shall not trim the password input box

Expected behavior:

The system should automatically trim any whitespaces from the beginning or end of the username or email, allowing the login attempt to proceed if the credentials are correct.

Actual behavior:

The system does not trim whitespaces, causing a login failure.

https://github.com/user-attachments/assets/1b47c6c1-3c7f-4dec-a5ce-515e0659530f

Reason for Trimming Whitespaces:

SinghaAnirban005 commented 3 weeks ago

Will raise a PR soon