mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
fix(usernames): various
Better modal positioning Correct text colors for input field Don't show "already taken" if username has other errors
This commit is contained in:
@@ -90,12 +90,14 @@ api.verifyUsername = {
|
||||
|
||||
const issues = verifyUsername(chosenUsername, res);
|
||||
|
||||
const existingUser = await User.findOne({
|
||||
'auth.local.lowerCaseUsername': chosenUsername.toLowerCase(),
|
||||
}, {auth: 1}).exec();
|
||||
if (issues.length < 1) {
|
||||
const existingUser = await User.findOne({
|
||||
'auth.local.lowerCaseUsername': chosenUsername.toLowerCase(),
|
||||
}, {auth: 1}).exec();
|
||||
|
||||
if (existingUser) {
|
||||
if (!user || existingUser._id !== user._id) issues.push(res.t('usernameTaken'));
|
||||
if (existingUser) {
|
||||
if (!user || existingUser._id !== user._id) issues.push(res.t('usernameTaken'));
|
||||
}
|
||||
}
|
||||
|
||||
if (issues.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user