fix: totp can't be enabled if user is a ldap user

This commit is contained in:
Elias Schneider
2024-11-23 18:55:47 +01:00
parent 18d8cbbbab
commit c8f05f2475
2 changed files with 11 additions and 5 deletions

View File

@@ -368,4 +368,12 @@ export class AuthService {
return null;
}
}
async verifyPassword(user: User, password: string) {
if (!user.password && this.config.get("ldap.enabled")) {
return !!this.ldapService.authenticateUser(user.username, password);
}
return argon.verify(user.password, password);
}
}