Skip to content

Commit

Permalink
Fix: managedの判定をしてなかった
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyatea committed Jul 17, 2024
1 parent ea8b3a9 commit 785a03c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/backend/src/core/SignupService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import UsersChart from '@/core/chart/charts/users.js';
import { UtilityService } from '@/core/UtilityService.js';
import { MetaService } from '@/core/MetaService.js';
import type { Config } from '@/config.js';
import { envOption } from "@/env.js";

@Injectable()
export class SignupService {
Expand Down Expand Up @@ -62,7 +63,7 @@ export class SignupService {
if (!this.userEntityService.validateLocalUsername(username)) {
throw new Error('INVALID_USERNAME');
}
if (this.config.maxLocalUsers !== -1 && await this.usersRepository.count({ where: { host: IsNull() } }) >= this.config.maxLocalUsers) {
if (envOption.managed && this.config.maxLocalUsers !== -1 && await this.usersRepository.count({ where: { host: IsNull() } }) >= this.config.maxLocalUsers) {
throw new Error('MAX_LOCAL_USERS');
}
if (password != null && passwordHash == null) {
Expand Down

0 comments on commit 785a03c

Please sign in to comment.