mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(server): drop salt column (#1185)
This commit is contained in:
parent
0c896d9e59
commit
4e860b024b
6 changed files with 20 additions and 25 deletions
|
|
@ -21,8 +21,7 @@ export class ResetAdminPasswordCommand extends CommandRunner {
|
|||
let { password } = await this.inquirer.ask<{ password: string }>('prompt-password', undefined);
|
||||
password = password || randomBytes(24).toString('base64').replace(/\W/g, '');
|
||||
|
||||
const salt = await bcrypt.genSalt();
|
||||
const hashedPassword = await bcrypt.hash(password, salt);
|
||||
const hashedPassword = await bcrypt.hash(password, 10);
|
||||
|
||||
const user = await this.userRepository.findOne({ where: { isAdmin: true } });
|
||||
if (!user) {
|
||||
|
|
@ -30,7 +29,6 @@ export class ResetAdminPasswordCommand extends CommandRunner {
|
|||
return;
|
||||
}
|
||||
|
||||
user.salt = salt;
|
||||
user.password = hashedPassword;
|
||||
user.shouldChangePassword = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue