Remove dependency on jinja2. Refactor social login.