cant find table column that i added to the user table in session

so basiclly i modified the user table and added a phone field but when i try to display it using the session hook useSession i get an erreur that the property does not exist on type user i added the additionalFields in the auth.ts file and i can successfully signUp and the phone gets added to the user table
<div className="flex flex-col space-y-0.5">
<p className="text-sm font-medium">
{session.user?.name || "User"}
</p>
<p className="text-xs text-muted-foreground truncate">
{session.user?.email || ""}
</p>
<p className="text-xs text-muted-foreground truncate">
{session.user?.phone || ""}
</p>
</div>
<div className="flex flex-col space-y-0.5">
<p className="text-sm font-medium">
{session.user?.name || "User"}
</p>
<p className="text-xs text-muted-foreground truncate">
{session.user?.email || ""}
</p>
<p className="text-xs text-muted-foreground truncate">
{session.user?.phone || ""}
</p>
</div>
Solution:
Have you added the additionalFields plugin on your client auth?
Jump to solution
6 Replies
Ping
Ping2mo ago
Could it be that your session is cached?
niifler
niiflerOP2mo ago
no the phone gets displayed but the error is still there its a type error basiclly
Ping
Ping2mo ago
Oh I see!
Solution
Ping
Ping2mo ago
Have you added the additionalFields plugin on your client auth?
niifler
niiflerOP2mo ago
yess ohh thank u i added the aditianal fileds but not
plugins: [inferAdditionalFields<typeof auth>()],
plugins: [inferAdditionalFields<typeof auth>()],
and
type Session = typeof auth.$Infer.Session
type Session = typeof auth.$Infer.Session
it works now

Did you find this page helpful?