additional fields not included in session
The role is included in the session object, but not the onboardingDone.
The fieldName is the same as that in the database

Solution:Jump to solution
If you're using an ORM, try removing the fieldName prop from the additional fields
22 Replies
Could it be that you're seeing a cached session that may not have your updated onboardingDone?
Thought so too. I tried deleting the session, but still don't see the field
When you check your DB, do you see that field populated?
yes
Also tried deleting the app and reinstalling which should remove all data
Is there any additional configurations that should be done in addition to adding the field to additionalFields?
No I don't believe so.
Are you verifying this by just calling
getSession
?I'm calling useSession
can try getSession
getting same result with getSession
This is werid. 🤔
Do you think you can send the whole auth config? Maybe I can spot something
Solution
If you're using an ORM, try removing the fieldName prop from the additional fields
Faced a similar issue some while back and the culprit was fieldName being passed manually
Thanks! that solved it 🙂
Thanks for all the help guys!
great to hear
Huh, interesting.
yep. using the drizzle adapter so it seems like it wants to map the fields to the name itself
makes sense since it already knows the field names
it doesn’t work even with an identical fieldName that's there in drizzle schema, which makes the behaviour a bit unclear
fieldName would usually only be used if the DB field name doesn't match the name of the key of that object (
onboardingDone
)
Is this the same idea that you guys have?yes
Hmm okay, this is very odd.
So I assume you renamed the
onboardingDone
key to onboarding_done
?yes. using automatic snake case conversion in drizzle. so made sense to declare the fieldName in the auth instance
@bekacru This might be a bug, I'm not too sure.
But previously @Emil set a fieldName to
onboarding_done
but this didn't work.
After removing fieldName
and just setting the key to onboarding_done
everything works.
🤔It’s not. The drizzle adapter works at the drizzle level. Meaning it only cares about what key is the field in your drizzle instance. So when you pass fieldName your changing the key name the adapter is looking for.
Hmm okay. So this is just a Drizzle related issue then.
It’s not an issue