Convex Auth user table fields
I've been looking for documentation on this with no avail.
Querying the users table strips all the fields other than _createdTime, _id, name, email
This is whether I used db.get or db.query. Any way around this?
I set up a role field on my Password provider profile and added it to the user table, but it doesn't get returned by the query
11 Replies
What does your schema look like?
Did you check the data on your Convex dashboard?
The data is unset for a lot of those on my test user.
I might just create a user_profiles table with a link to the user to store my metadata about the user so I don't mess around with the auth tables too much
Sounds like you're never setting
role
. What authentication methods are you using?Ah, it seems like unset fields are not returned. I thought it would return null?
Unset fields are not returned. You can do
v.union(v.null(), something)
if you want nulls.I am using convex auth, and I am only using Password
Then you'd want
role
to be returned by your profile
callback.Passwords - Convex Auth
Authentication library for your Convex backend
Ya, it is. But if it is unset, it isn't getting returned.
Ok, so unset is not the same as null?
Indeed
Ok, so if I do want those as nulls, I have to define my schema to accept nulls, and set them to null using that after create callback or w.e
Thanks I'll take a look at those docs