Skip to content

Commit 1abe60e

Browse files
committed
fix: remove password from user schema
1 parent 1afd02b commit 1abe60e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/demo/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { deepFreeze } from '@douglasneuroinformatics/libjs';
22
import type { CreateGroupData } from '@opendatacapture/schemas/group';
33
import type { User } from '@opendatacapture/schemas/user';
44

5-
type DemoUser = Pick<User, 'basePermissionLevel' | 'firstName' | 'lastName' | 'password' | 'username'> & {
5+
type DemoUser = Pick<User, 'basePermissionLevel' | 'firstName' | 'lastName' | 'username'> & {
66
groupNames: readonly string[];
7+
password: string;
78
};
89

910
type DemoGroup = CreateGroupData & { dummyIdPrefix?: string };

packages/schemas/src/user/user.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export const $User = $BaseModel.extend({
2323
firstName: z.string().min(1),
2424
groupIds: z.array(z.string()),
2525
lastName: z.string().min(1),
26-
password: z.string().min(1),
2726
sex: $Sex.nullish(),
2827
username: z.string().min(1)
2928
});
@@ -35,11 +34,11 @@ export const $CreateUserData = $User
3534
firstName: true,
3635
groupIds: true,
3736
lastName: true,
38-
password: true,
3937
username: true
4038
})
4139
.extend({
4240
dateOfBirth: z.coerce.date().optional(),
41+
password: z.string().min(1),
4342
sex: $Sex.optional()
4443
});
4544

0 commit comments

Comments
 (0)