link admin avatars by email-backed auth users
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-07-10 10:55:04 +09:00
parent 3873ce3169
commit 609c345739
+11 -2
View File
@@ -254,13 +254,22 @@ export class AdminAuthService {
throw new UnauthorizedException('관리자 세션이 유효하지 않습니다.');
}
const user = await this.authPrisma.user.findUnique({
let user = await this.authPrisma.user.findUnique({
where: { email: admin.email },
select: { id: true },
});
if (!user) {
throw new NotFoundException('프로필 이미지와 연결할 사용자 계정을 찾을 수 없습니다.');
user = await this.authPrisma.user.create({
data: {
email: admin.email,
passwordHash: hashPassword(randomBytes(24).toString('hex')),
name: admin.name,
role: 'ADMIN',
isActive: true,
},
select: { id: true },
});
}
return { admin, user };