Update user with additional fields

I've defined additional fields on my User struct
additionalFields: {
description: {
type: "string",
required: false,
},
status: {
type: "string",
required: true,
input: false,
},
...
additionalFields: {
description: {
type: "string",
required: false,
},
status: {
type: "string",
required: true,
input: false,
},
...
but then when I try to programmatically create a user, eg
await auth.api.updateUser({
body: {
name: "John",
status: "someStatus",
...
}
});
await auth.api.updateUser({
body: {
name: "John",
status: "someStatus",
...
}
});
it doesn't typecheck properly, is there something I have to do?
4 Replies
nowedont_
nowedont_2d ago
is additionalFields in user object?
mael
maelOP2d ago
the issue is because my fields where set to input: false but indeed if we set them to input: true it means anyone can override those values, so depending on each field it might or might not be suited
Vlad
Vlad2d ago
Update it using db
mael
maelOP2d ago
yes that's what I did thanks!

Did you find this page helpful?