Fix to make it work with latest flask login