Skip to content
Snippets Groups Projects
Commit b3ec47c3 authored by tamaina's avatar tamaina
Browse files

初期ユーザー登録時にはpreservedUsernamesを無視する

Fix #10738
parent a2e475f2
No related branches found
No related tags found
No related merge requests found
......@@ -139,7 +139,7 @@ export class SignupApiService {
const isPreserved = instance.preservedUsernames.map(x => x.toLowerCase()).includes(username.toLowerCase());
if (isPreserved) {
throw new FastifyReplyError(400, 'USED_USERNAME');
throw new FastifyReplyError(400, 'DENIED_USERNAME');
}
const code = rndstr('a-z0-9', 16);
......@@ -169,6 +169,7 @@ export class SignupApiService {
try {
const { account, secret } = await this.signupService.signup({
username, password, host,
ignorePreservedUsernames: (await this.usersRepository.countBy({ host: IsNull() })) === 0,
});
const res = await this.userEntityService.pack(account, account, {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment