fix(auth): add username field to RegisterScreen (#318) - #360
Merged
tilakpatel22 merged 1 commit intoJul 25, 2026
Merged
Conversation
Signup was inventing usernames from first+last name with no visible field, causing silent collisions and confusing validation errors. Collect username explicitly and pass it through to AuthManager::signup / OTP resend. Closes Fincept-Corporation#318 Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Hi @akmalsyrf — thanks for the PR! Our automated scope gate flagged the following: ❌ No scope-approved linked issue. This PR must close an issue that carries one of: Please read CONTRIBUTING.md. Once an issue with the appropriate label exists and is linked here, re-run this check by pushing an empty commit or editing the PR description. A maintainer can also bypass this gate by adding the PRs that remain unresolved for 7 days will be closed automatically. |
Collaborator
|
@akmalsyrf Thanks for the PR !! |
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.
Summary
Closes #318
The Windows (and all-platform) signup form never exposed a USERNAME field, even though
POST /user/registeralways requires one viaRegisterRequest::username. The UI silently invented a username by concatenating first + last name:That caused several user-visible failures matching the report:
John+Smith→johnsmithcollides with an existing account"Username must be 3-50 characters"appears with no username field on screenMary Janeproduce usernames with spaces that APIs rejectThis PR adds an explicit username input and wires it through the existing
AuthManager::signup()/ OTP-resend path. No AuthManager or AuthApi signature changes.Scope note for maintainers
Per
.github/CONTRIBUTING.md, PRs must link an issue labeledgood-first-issue,help-wanted, orscope:approved. Issue #318 currently hastype:bug+status:triageonly.Please add
good-first-issueorscope:approvedto #318 (or to this PR) so the scope gate clears. This is intentionally minimal and newcomer-sized: two files, one screen, one logical change.Changes
RegisterScreen.husername_lbl_/username_members alongside the other form fields.RegisterScreen.cppretranslateUi()(tr("USERNAME"),tr("3-50 chars, letters/numbers/_")).on_register():[a-z0-9_]after sanitize/lowercase (prevents the old space-from-name failure mode).AuthManager::signup(...).on_resend_otp()uses the same username field (no more name concatenation).username_on successful OTP verification with the other fields.First/last name fields are kept for UX continuity (they are still not sent to the API today — that is pre-existing and out of scope).
User-visible effect
Before: signup form = First / Last / Email / Phone / Password — username invented invisibly.
After: signup form includes USERNAME; the value the user types is what gets registered.
Test plan
fincept-qton your platform (cmake --build --preset <os>-releaseor local equivalent)."All fields are required".john smith,john@x) → charset error.What I could / could not verify locally
I did not run a full Qt 6.8.3 app build or hit
api.fincept.inend-to-end in this environment (upstream API TLS issues are tracked separately, e.g. #352). The change is UI-only against an already-correctsignup(username, ...)API surface; logic was reviewed againstAuthTypes.h/AuthManager::signup/AuthApiregister error paths.Out of scope (intentionally)
api.fincept.in)..ts/.qmupdates for the new strings ( Linguist will pick them up on the nextlupdatepass; Englishtr()sources are in place).Made with Cursor