mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-11-29 12:53:32 +03:00
1.1 KiB
1.1 KiB
userSignupFields
defines all the extra fields that need to be set on the User
during the sign-up process. For example, if you have address
and phone
fields on your User
entity, you can set them by defining the userSignupFields
like this:
import { defineUserSignupFields } from '@wasp/auth/index.js'
export const userSignupFields = defineUserSignupFields({
address: (data) => {
if (!data.address) {
throw new Error('Address is required')
}
return data.address
}
phone: (data) => data.phone,
})
import { defineUserSignupFields } from '@wasp/auth/index.js'
export const userSignupFields = defineUserSignupFields({
address: (data) => {
if (!data.address) {
throw new Error('Address is required')
}
return data.address
}
phone: (data) => data.phone,
})
Read more about the userSignupFields
function here.