Skip to content

Commit ef86ef4

Browse files
authored
Merge pull request #1436 from CVEProject/dr-1409-argon-calls
Resolves issue #1409, Make Argon2 calls consistant
2 parents 7ddfac0 + 1728ff4 commit ef86ef4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/controller/org.controller/org.controller.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,9 @@ async function resetSecret (req, res, next) {
13461346
}
13471347

13481348
randomKey = cryptoRandomString({ length: getConstants().CRYPTO_RANDOM_STRING_LENGTH })
1349-
oldUser.secret = await argon2.hash(randomKey) // store in db
1350-
oldUserRegistry.secret = await argon2.hash(randomKey) // store in db
1349+
const secret = await argon2.hash(randomKey)
1350+
oldUser.secret = secret
1351+
oldUserRegistry.secret = secret
13511352

13521353
const user = await userRepo.updateByUserNameAndOrgUUID(oldUser.username, orgUUID, oldUser, { session })
13531354
const userReg = await userRegistryRepo.updateByUserNameAndOrgUUID(oldUserRegistry.user_id, orgRegUUID, oldUserRegistry, { session })

0 commit comments

Comments
 (0)