RocketChat / RocketChat/Rocket.Chat
Username availability check missing in Setup Wizard admin step
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
In AdminInfoStep.tsx, the username validation was missing an API check to verify if the username is already taken:
Expected Behavior
validateUsernameshould call the users.checkUsernameAvailabilityAPI endpoint and return an error message if the username is already in use.
Current Behavior
// TODO: check if username exists
const validateUsername = (username: string): boolean | string => {
if (!usernameRegExp.test(username) || hasBlockedName(username)) {
return t('Invalid_username');
}
return true;
};
Steps to Reproduce
See packages/ui-client/src/views/setupWizard/steps/AdminInfoStep.tsx
Additional Context
checkUsernameAvailabilityendpoint GET/v1/users.checkUsernameAvailabilityis already available in the API- No runtime behavior changes beyond the added API call
- The following should be changed in
AdminInfoStep.tsx,SetupWizardContext.ts,SetupWizardProvider.tsx
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/ui-client/src/views/setupWizard/steps/AdminInfoStep.tsx and trace the username validation flow into SetupWizardContext.ts and SetupWizardProvider.tsx. Confirm how the existing users.checkUsernameAvailability endpoint is called, then verify that an already-used username produces an error while valid available names still pass validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100