mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): new password repo method (#8208)
This commit is contained in:
parent
604b8ff17c
commit
787eebcf1e
9 changed files with 15 additions and 10 deletions
|
|
@ -146,7 +146,6 @@ export class AuthService {
|
|||
|
||||
async adminSignUp(dto: SignUpDto): Promise<UserResponseDto> {
|
||||
const adminUser = await this.userRepository.getAdmin();
|
||||
|
||||
if (adminUser) {
|
||||
throw new BadRequestException('The server already has an admin');
|
||||
}
|
||||
|
|
@ -427,7 +426,7 @@ export class AuthService {
|
|||
}
|
||||
|
||||
private async createLoginResponse(user: UserEntity, authType: AuthType, loginDetails: LoginDetails) {
|
||||
const key = this.cryptoRepository.randomBytes(32).toString('base64').replaceAll(/\W/g, '');
|
||||
const key = this.cryptoRepository.newPassword(32);
|
||||
const token = this.cryptoRepository.hashSha256(key);
|
||||
|
||||
await this.userTokenRepository.create({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue