Bryan
Bryan•4mo ago

Issue using auth with custom user schema

I have my auth set up with a custom user schema like so..
export default defineSchema({
...authTables,
users: defineTable({
name: v.string(),
email: v.string(),
emailVerificationTime: v.optional(v.number()),
phone: v.optional(v.string()),
phoneVerificationTime: v.optional(v.number()),
isAnonymous: v.optional(v.boolean()),
password: v.string(),
profileImageUrl: v.optional(v.string()),
activePet: v.optional(v.id('pets')),
}).index('email', ['email']),
});
export default defineSchema({
...authTables,
users: defineTable({
name: v.string(),
email: v.string(),
emailVerificationTime: v.optional(v.number()),
phone: v.optional(v.string()),
phoneVerificationTime: v.optional(v.number()),
isAnonymous: v.optional(v.boolean()),
password: v.string(),
profileImageUrl: v.optional(v.string()),
activePet: v.optional(v.id('pets')),
}).index('email', ['email']),
});
I'm also returning those fields to the user profile with like so in a CustomPassword file
export default Password<DataModel>({
profile(params) {
return {
name: params.name as string,
email: params.email as string,
phone: params.phone as string | undefined,
password: params.password as string,
};
},
});
export default Password<DataModel>({
profile(params) {
return {
name: params.name as string,
email: params.email as string,
phone: params.phone as string | undefined,
password: params.password as string,
};
},
});
but upon trying to sign up I'm running into an error (see attachment) on signup I'm calling this function below
const onSignUpPress = async () => {
try {
const { signingIn } = await signIn('password', {
name: fullName,
email: emailAddress,
password,
flow: 'signUp',
});

// if successfully signed up, navigate to home
if (signingIn) router.navigate('/');
} catch (err) {
console.error('Error signing up: ', err);
}
};
const onSignUpPress = async () => {
try {
const { signingIn } = await signIn('password', {
name: fullName,
email: emailAddress,
password,
flow: 'signUp',
});

// if successfully signed up, navigate to home
if (signingIn) router.navigate('/');
} catch (err) {
console.error('Error signing up: ', err);
}
};
Any ideas what might be causing the issue?
No description
4 Replies
Convex Bot
Convex Bot•4mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
jamalsoueidan
jamalsoueidan•4mo ago
You can see that the sign up is only receiving your email, not the rest of the data... 🙂
Bryan
BryanOP•4mo ago
what's odd is that I'm passing them in as seen in the onSignUpPress function call, but it's not registering
jamalsoueidan
jamalsoueidan•4mo ago
{ name: fullName, email: emailAddress, password, flow: 'signUp', } try to type them yourself { name: "asdasd", email: "asd@asd.dk", password: "asdasd", flow: 'signUp', } and see if that works

Did you find this page helpful?