Skip to content

Commit 2e69224

Browse files
committed
fix: disallow passwort reset if it's a ldap user
1 parent 1e96011 commit 2e69224

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

backend/src/auth/auth.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ export class AuthService {
146146

147147
if (!user) return;
148148

149+
if (user.ldapDN) {
150+
this.logger.log(
151+
`Failed password reset request for user ${email} because it is an LDAP user`,
152+
);
153+
throw new BadRequestException(
154+
"This account can't reset its password here. Please contact your administrator.",
155+
);
156+
}
157+
149158
// Delete old reset password token
150159
if (user.resetPasswordToken) {
151160
await this.prisma.resetPasswordToken.delete({

0 commit comments

Comments
 (0)