If you want to add a password to your site, while using ngrok follow these steps.
Note: While this is secure it's not considered super secure (but it's secure enough).
In the Raspberry Pi terminal type:
$ sudo nano /home/pi/.config/ngrok/ngrok.yml
This will allow you to edit the ngrok configuration file.
Do not delete anything in the file and add the following at the bottom, but change the hostname to match your app name. Change the password and username.
tunnels:
my_tunnel:
addr: 8888
basic_auth:
- "username:password"
hostname: your-app.ngrok-free.app
proto: http
Press CNTL X to exit and say Yes to save the file.
Launch your "tunnel" by typing the following in the terminal:
$ ngrok start my_tunnel
Make sure the Raspberry Pi is running your web app then go to your site and see if the password works.
Keep in mind that the password is stored as a cookie in your browser. If you return to the site on the same browser, you will not need the password until you clear your browser history or use an incognito browser.