Work around API change in Flask-Login.