Skip to content

Commit ef8ae38

Browse files
committed
fix: Fix user creating/editing in project gernerated by CLI - fix password_hash name after refactoring
1 parent f9e8109 commit ef8ae38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adminforth/commands/createApp/templates/adminuser.ts.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ export default {
8888
hooks: {
8989
create: {
9090
beforeSave: async ({ record, adminUser, resource }: { record: any, adminUser: AdminUser, resource: AdminForthResource }) => {
91-
record.passwordHash = await AdminForth.Utils.generatePasswordHash(record.password);
91+
record.password_hash = await AdminForth.Utils.generatePasswordHash(record.password);
9292
return { ok: true };
9393
}
9494
},
9595
edit: {
9696
beforeSave: async ({ updates, adminUser, resource }: { updates: any, adminUser: AdminUser, resource: AdminForthResource }) => {
9797
console.log('Updating user', updates);
9898
if (updates.password) {
99-
updates.passwordHash = await AdminForth.Utils.generatePasswordHash(updates.password);
99+
updates.password_hash = await AdminForth.Utils.generatePasswordHash(updates.password);
100100
}
101101
return { ok: true }
102102
},

0 commit comments

Comments
 (0)