1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-15 03:50:11 +01:00

fix: disallow passwort reset if it's a ldap user

This commit is contained in:
Elias Schneider 2024-10-15 20:12:56 +02:00
parent 1e96011793
commit 2e692241c5
No known key found for this signature in database
GPG Key ID: 07E623B294202B6C

View File

@ -146,6 +146,15 @@ export class AuthService {
if (!user) return;
if (user.ldapDN) {
this.logger.log(
`Failed password reset request for user ${email} because it is an LDAP user`,
);
throw new BadRequestException(
"This account can't reset its password here. Please contact your administrator.",
);
}
// Delete old reset password token
if (user.resetPasswordToken) {
await this.prisma.resetPasswordToken.delete({