Custom email encryption / customize data saved in sessions

I just switched from auth.js (formerly next auth) to better auth, and I don't quite understand how to set up custom sessions. With auth.js, you could decide what was stored in the session. Since I only store all emails as hashes and encrypted versions in the database, I don't want them to be visible in the session as plain text. So, how can I adapt the session accordingly? I also need additional fields (role, for example) in my session that are also stored in my database.
Was this page helpful?