Additional fields

I'm currently stuck with this:
model User {
  id              String        @id
  name            String
 ...
  updatedAt       DateTime
  role            String?
 ...
  username        String?
  displayUsername String?
  sessions        Session[]
  accounts        Account[]
  userDetails     UserDetails?
...
}

How can I pass userDetails fields during the sign-in function?
I've already tried adding this:
inferAdditionalFields({
        user:
              surname: {
                type: "string",
                required: true,
              },
              role: {
                type: "string",
                required: true,
                defaultValue: "user",
              },
              gender: {
                type: "string",
                references: {
                  model: "UserDetails",
                  field: "gender",
                },
              },
...


(error: [HTTP/1.1 422 UNPROCESSABLE_ENTITY 441ms] )
Was this page helpful?