fix: pad auto-generated username/name to minimum 3 characters - #57
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/yash-pouranik/urBackend/sessions/6a9927b1-d793-4ed5-a1c5-f495d39db2e2 Co-authored-by: yash-pouranik <172860064+yash-pouranik@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix auto-generated username from email prefix to meet length requirement
fix: pad auto-generated username/name to minimum 3 characters
Mar 28, 2026
yash-pouranik
marked this pull request as ready for review
March 28, 2026 09:15
yash-pouranik
approved these changes
Mar 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates buildAuthUserPayload in both API services to ensure auto-generated name / username values derived from the email prefix meet a minimum length of 3 characters, aligning with downstream username length requirements.
Changes:
- Auto-generate
namefromusernameor email prefix, padding to 3 chars when needed. - Auto-generate
usernamefrompayload.nameor email prefix, padding to 3 chars when needed. - Apply the same logic in both
public-apianddashboard-apicontroller implementations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/public-api/src/controllers/userAuth.controller.js | Pads derived name/username to at least 3 characters during signup/admin-create flows. |
| apps/dashboard-api/src/controllers/userAuth.controller.js | Mirrors the same minimum-length padding behavior for derived name/username. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
yash-pouranik
temporarily deployed
to
copilot/fix-auto-generated-username-length - urBackend-frankfrut PR #57
March 28, 2026 09:20 — with
Render
Destroyed
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
yash-pouranik
temporarily deployed
to
copilot/fix-auto-generated-username-length - urBackend-frankfrut PR #57
March 28, 2026 09:21 — with
Render
Destroyed
yash-pouranik
added a commit
that referenced
this pull request
Apr 18, 2026
…outes - fix(dashboard-api): create `publicLimiter` for non-sensitive data queries - fix(dashboard-api): apply `publicLimiter` to `GET /api/waitlist/count` endpoint - fix(dashboard-api): apply strict `authLimiter` to `GET /api/waitlist/admin` endpoint - chore: address CodeQL alerts #55, #56, #57 regarding missing rate limiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
buildAuthUserPayloadderivesnameandusernamefrom the email prefix when those fields are required but absent — e.g.a@b.com→"a", which undercuts the ≥3-char minimum enforced inupdateProfile.Changes
public-apianddashboard-apiuserAuth.controller.js: Extract the derived value into a variable and applypadEnd(3, '0')when its length is under 3, applied consistently to both thenameandusernameauto-generation blocks.Applies the same guard to the
namefallback block for consistency.💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.