This is not a simple function to do. There are a couple ways to accomplish this but you need a server of some kind. This function is generically called a captive portal.
This tends to be very hard unless you want to display a simple disclaimer on a home router. There just is not enough memory or processing power on most routers.
Still the router must have the ability to redirect the traffic to a server which then does the authorization and tell the router to allow the traffic. This is not a common feature in factory software but some third party images have the ability.
Since you need a server anyway using pfsense to act as the router would likely be the simplest.
Now this does not actually protect the wifi itself. They...