a lot of changes following flask-security doc