mirror of
https://github.com/stonith404/pingvin-share.git
synced 2025-01-15 01:14:27 -05:00
fix: disallow passwort reset if it's a ldap user
This commit is contained in:
parent
1e96011793
commit
2e692241c5
1 changed files with 9 additions and 0 deletions
|
@ -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({
|
||||
|
|
Loading…
Add table
Reference in a new issue