chore(backend): Add comments about password rehashing

This commit is contained in:
Shun Sakai 2024-10-24 19:54:29 +09:00 committed by GitHub
parent b2dc13b751
commit 867762f88b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -205,7 +205,9 @@ export class SigninApiService {
}
if (same) {
// Check if the password is still hashed using bcrypt
if (profile.password!.startsWith('$2')) {
// Rehash the password using Argon2
const newHash = await argon2.hash(password);
this.userProfilesRepository.update(user.id, {
password: newHash,
@ -227,7 +229,9 @@ export class SigninApiService {
}
try {
// Check if the password is still hashed using bcrypt
if (profile.password!.startsWith('$2')) {
// Rehash the password using Argon2
const newHash = await argon2.hash(password);
this.userProfilesRepository.update(user.id, {
password: newHash,