refactor(backend): Improve UUID generation (#11286)
* Replace with `crypto.randomUUID()` * Remove uuid
This commit is contained in:
parent
9d5dd7201e
commit
b392f44b81
9 changed files with 25 additions and 34 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { randomUUID } from 'node:crypto';
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import bcrypt from 'bcryptjs';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { IsNull, DataSource } from 'typeorm';
|
||||
import { genRsaKeyPair } from '@/misc/gen-key-pair.js';
|
||||
import { User } from '@/models/entities/User.js';
|
||||
|
|
@ -24,7 +24,7 @@ export class CreateSystemUserService {
|
|||
|
||||
@bindThis
|
||||
public async createSystemUser(username: string): Promise<User> {
|
||||
const password = uuid();
|
||||
const password = randomUUID();
|
||||
|
||||
// Generate hash of password
|
||||
const salt = await bcrypt.genSalt(8);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue