Google auth configFn and userSignupFields
When I add either of these functions to my main.wasp, I get errors.
My google auth method looks like this:
google: {
configFn: import { getConfig } from "@src/pages/auth/google.jsx",
userSignupFields: import { userSignupFields } from "@src/pages/auth/google.jsx"
},
I have a google.jsx file created under src/pages/auth/google.jsx with the following:
import { defineUserSignupFields } from 'wasp/server/auth'
export const userSignupFields = defineUserSignupFields({
displayName: (data) => data.profile.name,
address: (data) => {
if (!data.address) {
throw new Error('Address is required')
}
return data.address
},
phone: (data) => data.phone,
})
export function getConfig() {
return {
scopes: ['profile', 'email'],
}
}
My google auth method looks like this:
google: {
configFn: import { getConfig } from "@src/pages/auth/google.jsx",
userSignupFields: import { userSignupFields } from "@src/pages/auth/google.jsx"
},
I have a google.jsx file created under src/pages/auth/google.jsx with the following:
import { defineUserSignupFields } from 'wasp/server/auth'
export const userSignupFields = defineUserSignupFields({
displayName: (data) => data.profile.name,
address: (data) => {
if (!data.address) {
throw new Error('Address is required')
}
return data.address
},
phone: (data) => data.phone,
})
export function getConfig() {
return {
scopes: ['profile', 'email'],
}
}