can we use database functions using the edge runtime in nextjs? yes and no. you cannot directly use it but i have found out a solution to this, one method is to make an route handler (api). and using fetch in the edge runtime.
Possible Method for you usecase
in auth.js you can create separate auth.config.ts (which will not be using any kind of database operation that is not supported in the edge runtime github authjs5-nextjs