feat: disable admin setup (#24628)

This commit is contained in:
Jason Rasmussen
2025-12-22 14:15:08 -05:00
committed by GitHub
parent f99f5f4f91
commit 5a7c9a252c
8 changed files with 69 additions and 10 deletions
+5
View File
@@ -165,6 +165,11 @@ export class AuthService extends BaseService {
}
async adminSignUp(dto: SignUpDto): Promise<UserAdminResponseDto> {
const { setup } = this.configRepository.getEnv();
if (!setup.allow) {
throw new BadRequestException('Admin setup is disabled');
}
const adminUser = await this.userRepository.getAdmin();
if (adminUser) {
throw new BadRequestException('The server already has an admin');