updated app.py to use authentication database