Implement functionality to ensure that user display names meet specific criteria:
Display name must contain no spaces.
Display name must contain no symbols.
Display name must be less than 16 characters.
Display name must be unique.
Details
Currently, our system allows users to set their display names freely. However, we've identified the need to enforce stricter constraints on display names to enhance user experience and maintain consistency across the platform.
Requirements
No Spaces: Display names should not contain any spaces. Users should be prompted to enter a name without spaces if they attempt to include them.
No Symbols: Display names should not include any symbols. This includes special characters, punctuation, and emojis.
Length Limit: Display names should be limited to a maximum of 16 characters. Longer names may be truncated to fit within this limit.
Uniqueness: Each display name must be unique across the platform. Users should be notified if their chosen name is already in use and prompted to select a different one.
Proposed Implementation
Implement validation checks on the frontend to enforce the constraints outlined above when users attempt to set or update their display names.
Implement corresponding validation logic on the backend to ensure consistency and prevent circumvention of the rules.
Provide clear error messages to users if their chosen display name does not meet the specified criteria.
Implement database queries to check for uniqueness of display names during registration and updates.
Additional Considerations
Consider the impact of existing users who may have display names that do not conform to the new constraints. We may need to provide guidance or options for updating their names.
Consider internationalization and localization requirements when displaying error messages or prompting users for input.
Related Issues
if you want to test with a database, create a .env file and put firebase firestore database with
VITE_FIREBASE_API_KEY=
VITE_FIREBASE_AUTH_DOMAIN=
VITE_FIREBASE_PROJECT_ID=
VITE_FIREBASE_STORAGE_BUCKET=
VITE_FIREBASE_MESSAGING_SENDER_ID=
VITE_FIREBASE_APP_ID=
VITE_FIREBASE_MEASUREMENT_ID=***
Unique Display Names with Constraints
Description
Objective
Implement functionality to ensure that user display names meet specific criteria:
Details
Currently, our system allows users to set their display names freely. However, we've identified the need to enforce stricter constraints on display names to enhance user experience and maintain consistency across the platform.
Requirements
Proposed Implementation
Additional Considerations
Related Issues