If app_metadata isActive == true redirect user to /dashbaord if not /signup

Hi,

I would like to achieve below using an ACTION FLOW.

If app_metadata isActive == true redirect user to /dashbaord if not /signup

But, I need to be able to use session.user.email inside my app too. For an example, when the user is redirected to /signup, I still need to be able to access the session.user.email using my apps’ javascript code (next.js app using next-auth)

Any help is appreciated.