Skip to content

Commit

Permalink
Fix passing hashed password
Browse files Browse the repository at this point in the history
  • Loading branch information
joeauyeung committed Feb 14, 2025
1 parent 0624b4a commit 527539e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/lib/server/repository/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ export class UserRepository {
}
) {
const organizationIdValue = data.organizationId;
const { email, username, creationSource, locked, ...rest } = data;
const { email, username, creationSource, locked, hashedPassword, ...rest } = data;

logger.info("create user", { email, username, organizationIdValue, locked });
const t = await getTranslation("en", "common");
Expand All @@ -597,7 +597,7 @@ export class UserRepository {
data: {
username,
email: email,
...(data.hashedPassword && { password: { create: { hash: data.hashedPassword } } }),
...(hashedPassword && { password: { create: { hash: hashedPassword } } }),
// Default schedule
schedules: {
create: {
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/server/service/userCreationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export class UserCreationService {

log.info(`Created user: ${user.id} with locked status of ${user.locked}`);

const { locked, ...rest } = user;
const { locked, ...restUser } = user;

return rest;
return restUser;
}
}

0 comments on commit 527539e

Please sign in to comment.