auth.api.signInAnonymous({}) doesn't contain additionalFields properties for user object on resolve

using nextjs current version and current version of better-auth. Using the anonymous login plugin. I've defined
user: {
modelName: 'users',
additionalFields: {
orders: {
returned: true,
type: 'json',
required: false,
defaultValue: [],
},
},
},
user: {
modelName: 'users',
additionalFields: {
orders: {
returned: true,
type: 'json',
required: false,
defaultValue: [],
},
},
},
but when calling the login:
export async function submit(data) {
'use server'
console.log('submit data', data)
const anon = await auth.api.signInAnonymous()

console.log('anon', anon.user)

}
export async function submit(data) {
'use server'
console.log('submit data', data)
const anon = await auth.api.signInAnonymous()

console.log('anon', anon.user)

}
the logged user does not contain the orders property. I would expect at least a default value of the empty array. none of the robots have provided informed helpful solutions, hence why I'm here. Any ideas?
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?