base impl of flask-login