refactor(backend): don't create local user if password is too weak

This prevents the previous problem that the backend created a user that was then not correctly removed again

Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Philip Molares 2023-01-08 20:45:07 +01:00 committed by David Mehren
parent 45e70434c4
commit 47d1765b12
2 changed files with 3 additions and 2 deletions

View file

@ -58,6 +58,7 @@ export class AuthController {
@Req() request: RequestWithSession,
@Body() registerDto: RegisterDto,
): Promise<void> {
await this.identityService.checkPasswordStrength(registerDto.password);
const user = await this.usersService.createUser(
registerDto.username,
registerDto.displayName,