Skip to content

bug: Login fails due to untrimmed whitespace in email/username #1900

@Ankitsinghsisodya

Description

@Ankitsinghsisodya

Describe the bug
The login functionality on the CMS does not strip leading or trailing whitespace from the user input fields (specifically email/username). If a user accidentally includes a space (often happening during copy-pasting or auto-fill), the validation fails or the backend rejects the credentials, leading to a frustrating user experience.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the CMS login page.
  2. Enter a valid registered email address but add a trailing space (e.g., "user@example.com ").
  3. Enter the correct password.
  4. Click the Login button.
  5. See error: The system rejects the login attempt (likely due to an "Invalid credentials" error or similar validation failure), even though the core credentials are correct.

Expected behavior
The application should automatically trim() the input values for the email/username fields before sending the request to the backend. This ensures that accidental whitespace does not prevent a valid user from logging in.

Info (please complete the following information):

  • Browser: [e.g. Chrome, Firefox]
  • Version: [e.g. Latest]

Additional context
This is a common UX issue when users copy-paste their email addresses from other sources or when mobile keyboards auto-insert spaces.
Suggested Fix: Apply .trim() to the input string in the onChange handler or just before the form submission logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions