Copying reset password changes (#12108)

This commit is contained in:
Muhsin Shah C P 2025-03-04 20:18:30 +05:30 committed by GitHub
parent c5a06423ef
commit 3828c93e23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -320,6 +320,11 @@ export class OauthService implements IOAuthService {
organizationDetails = await this.organizationRepository.fetchOrganization(userDetails.defaultOrganizationId);
}
// Clear forgot password token
if (userDetails.forgotPasswordToken) {
await this.userRepository.updateOne(userDetails.id, { forgotPasswordToken: null }, manager);
}
return await this.sessionUtilService.generateLoginResultPayload(
response,
userDetails,

View file

@ -109,6 +109,7 @@ export class AuthService implements IAuthService {
const updateData = {
...(shouldUpdateDefaultOrgId && { defaultOrganizationId: organization?.id }),
passwordRetryCount: 0,
forgotPasswordToken: null,
};
await this.userRepository.updateOne(user.id, updateData, manager);