fix: password was hashed twice
This commit is contained in:
parent
b761bf876e
commit
17b258e3cc
@ -310,6 +310,9 @@ export class PASSWORD extends STRING {
|
|||||||
}
|
}
|
||||||
const value = model.get(name) as string;
|
const value = model.get(name) as string;
|
||||||
if (value) {
|
if (value) {
|
||||||
|
if (value.startsWith('$2b$10$') && value.length === 60) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const hash = await bcrypt.hash(value, 10);
|
const hash = await bcrypt.hash(value, 10);
|
||||||
model.set(name, hash);
|
model.set(name, hash);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user