This piece of code extends the official nicegui authentication sample that can be found here
To run this app, you need to get your site and secret key from hcaptcha.com. Add them to the .env file and you're ready to start the app using python3 app.py
For more information on the changes and the script check this out.