How to return custom session with modified DB fields

Hi there,

Currently to created custom session you do something along lines of:

 customSession(async ({user, session}) => {
          return {
            user,
            session
          };
        })


If I modified the user fields that are saved to the db as follows:

 user: {
        fields: {
          emailVerified: "email_verified",
          createdAt: "date_created",
          updatedAt: "date_updated"
        },
}


I would expect that user in custom session to have email_verified, date_created etc. However as per attached image I am not seeing this as the case. Is there a reason for this?
image.png
Was this page helpful?