Generic OAuth custom authorization logic

Hi there!

I am using the Generic OAuth plugin in Nextjs with Hubspot and need to add some functionality that will deny a user access based on their email or associated user info, preventing these users signing up/accessing pages covered by the middleware.

Is there a nice way of doing this without getting the session in the middleware and denying based on data? As that requires a database call.
Was this page helpful?