Hotfix for recent Flask/Werkzeug versions breaking Flask-Login module
(cherry picked from commit 84caaeb)