mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-15 12:16:22 +00:00
fix(auth): account for new username paradigm in add-local flow
This commit is contained in:
parent
8b610d771c
commit
45a757b589
2 changed files with 1 additions and 2 deletions
|
|
@ -42,7 +42,6 @@
|
|||
|
||||
"messageAuthPasswordMustMatch": ":password and :confirmPassword don't match",
|
||||
"messageAuthCredentialsRequired": ":username, :email, :password, :confirmPassword required",
|
||||
"messageAuthUsernameTaken": "Username already taken",
|
||||
"messageAuthEmailTaken": "Email already taken",
|
||||
"messageAuthNoUserFound": "No user found.",
|
||||
"messageAuthMustBeLoggedIn": "You must be logged in.",
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ async function registerLocal (req, res, { isV3 = false }) {
|
|||
if (user) {
|
||||
if (email === user.auth.local.email) throw new NotAuthorized(res.t('emailTaken'));
|
||||
// Check that the lowercase username isn't already used
|
||||
if (lowerCaseUsername === user.auth.local.lowerCaseUsername) throw new NotAuthorized(res.t('usernameTaken'));
|
||||
if (lowerCaseUsername === user.auth.local.lowerCaseUsername && existingUser._id !== user._id) throw new NotAuthorized(res.t('usernameTaken'));
|
||||
}
|
||||
|
||||
let hashed_password = await passwordUtils.bcryptHash(password); // eslint-disable-line camelcase
|
||||
|
|
|
|||
Loading…
Reference in a new issue