Workaround to handle encoding issues in flask.ext.login