@identity_loaded.connect_via(app)
def on_identity_loaded(sender, identity):
    """ This function is called by Flask-Principal after a user logs in. """
identity.user = current_user
if isinstance(current_user, User):
    identity.provides.add(UserNeed(current_user.id))
for permission in user.permissions:
    pass
Flask Login и Principal - current_user является анонимным, хотя я вошел в систему