|
5 | 5 | import { AppSystemProp, logger, system } from '@openops/server-shared'; |
6 | 6 | import { OrganizationRole, Provider, User } from '@openops/shared'; |
7 | 7 | import { authenticationService } from '../../authentication/basic/authentication-service'; |
8 | | -import { passwordHasher } from '../../authentication/basic/password-hasher'; |
9 | 8 | import { openopsTables } from '../../openops-tables'; |
10 | 9 | import { authenticateAdminUserInOpenOpsTables } from '../../openops-tables/auth-admin-tables'; |
11 | 10 | import { organizationService } from '../../organization/organization.service'; |
@@ -168,23 +167,16 @@ async function upsertAdminPassword( |
168 | 167 | user: User, |
169 | 168 | newPassword: string, |
170 | 169 | ): Promise<void> { |
171 | | - const passwordMatches = await passwordHasher.compare( |
172 | | - newPassword, |
173 | | - user.password, |
174 | | - ); |
175 | | - |
176 | | - if (!passwordMatches) { |
177 | | - const email = user.email; |
178 | | - logger.info(`Updating password for admin [${email}]`, email); |
| 170 | + const email = user.email; |
| 171 | + logger.info(`Updating password for admin [${email}]`, email); |
179 | 172 |
|
180 | | - const updatedUser = await userService.updatePassword({ |
181 | | - id: user.id, |
182 | | - newPassword, |
183 | | - }); |
| 173 | + const updatedUser = await userService.updatePassword({ |
| 174 | + id: user.id, |
| 175 | + newPassword, |
| 176 | + }); |
184 | 177 |
|
185 | | - const { token } = await authenticateUserInOpenOpsTables(email, newPassword); |
186 | | - await resetUserPassword(email, updatedUser.password, token); |
187 | | - } |
| 178 | + const { token } = await authenticateUserInOpenOpsTables(email, newPassword); |
| 179 | + await resetUserPassword(email, updatedUser.password, token); |
188 | 180 | } |
189 | 181 |
|
190 | 182 | async function upsertAdminEmail(user: User, email: string): Promise<void> { |
|
0 commit comments