diff options
Diffstat (limited to 'server/helpers/custom-validators/accounts.ts')
-rw-r--r-- | server/helpers/custom-validators/accounts.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/helpers/custom-validators/accounts.ts b/server/helpers/custom-validators/accounts.ts index 00dea9039..0607d661c 100644 --- a/server/helpers/custom-validators/accounts.ts +++ b/server/helpers/custom-validators/accounts.ts | |||
@@ -5,6 +5,7 @@ import * as validator from 'validator' | |||
5 | import { AccountModel } from '../../models/account/account' | 5 | import { AccountModel } from '../../models/account/account' |
6 | import { isUserDescriptionValid, isUserUsernameValid } from './users' | 6 | import { isUserDescriptionValid, isUserUsernameValid } from './users' |
7 | import { exists } from './misc' | 7 | import { exists } from './misc' |
8 | import { CONFIG } from '../../initializers' | ||
8 | 9 | ||
9 | function isAccountNameValid (value: string) { | 10 | function isAccountNameValid (value: string) { |
10 | return isUserUsernameValid(value) | 11 | return isUserUsernameValid(value) |
@@ -40,7 +41,7 @@ function isAccountNameWithHostExist (nameWithDomain: string, res: Response, send | |||
40 | const [ accountName, host ] = nameWithDomain.split('@') | 41 | const [ accountName, host ] = nameWithDomain.split('@') |
41 | 42 | ||
42 | let promise: Bluebird<AccountModel> | 43 | let promise: Bluebird<AccountModel> |
43 | if (!host) promise = AccountModel.loadLocalByName(accountName) | 44 | if (!host || host === CONFIG.WEBSERVER.HOST) promise = AccountModel.loadLocalByName(accountName) |
44 | else promise = AccountModel.loadLocalByNameAndHost(accountName, host) | 45 | else promise = AccountModel.loadLocalByNameAndHost(accountName, host) |
45 | 46 | ||
46 | return isAccountExist(promise, res, sendNotFound) | 47 | return isAccountExist(promise, res, sendNotFound) |