feat: implement unique username validation in updateProfile controller#961
Open
varshitha980-vvc wants to merge 10 commits into
Open
feat: implement unique username validation in updateProfile controller#961varshitha980-vvc wants to merge 10 commits into
varshitha980-vvc wants to merge 10 commits into
Conversation
Owner
|
@varshitha980-vvc resolve conflicts and do linting |
Author
|
Hi @aryandas2911 , the conflicts on this PR are fully resolved and it's ready for your review whenever you can approve the CI workflow |
Owner
|
@varshitha980-vvc your code is very messed up because of <<<<Head and ----- such lines, pls remove those |
Owner
|
@varshitha980-vvc no changes have yet been done, to the changes requested |
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.
Description
Added a validation check in the
updateProfilecontroller to ensure usernames are unique before saving updates to the database.Changes Made
backend/controllers/authController.jsto check if the requestednameis already taken by another user usingUser.findOne({ name }).400status with a clear error message if the username is already taken.backend/middlewares/authMiddleware.js.Closes #889