-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
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:
- Go to the CMS login page.
- Enter a valid registered email address but add a trailing space (e.g., "user@example.com ").
- Enter the correct password.
- Click the Login button.
- 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.