dtauerbach / apollo

Apollo Project website
1 stars 0 forks source link

Get new login/sign up pages working with flask-security #24

Closed dtauerbach closed 10 years ago

dtauerbach commented 10 years ago

One thing we have to figure out is how to make the flask style for user authentication, e.g.

{% if current_user.is_authenticated() %}

translate to what I presume is Angular's authentication scheme e.g.

<ul class="header_topnav" data-ng-show="authenticated">
dtauerbach commented 10 years ago

@iwein I've created a new branch 'fix-forms' for this, since it is orthogonal (I think) to the current Bootstrap requirement for the modals. The idea is that the forms we make are using a Flask extension called flask-security (http://pythonhosted.org/Flask-Security/), which nicely packages lots of cool features.

If you work in this branch, look at /newjoin. That is your beautiful form. Now look at /register. That is the one that uses flask-security. The goal is to make /register look like /newjoin while preserving the flask-security aspects of the form. To do this, the file that provides the form markup for /register is in the repo at templates/partials/register_form.html. The file that provides the markup for /newjoin is at templates/pages/join.html. If there's a way to trick the flask-security form into looking like your form, that is ideal. Commit ec4f0fe47cd250641f54ae93f91b9d5ae8298dcc is a first pass at trying to do this, but there are other things to be figured out.

Finally, the old Social buttons do not work, because the Javascript that they rely on may have been clobbered by Angular. The Persona JS is in static/js/global.js, the Google and Facebook routes are defined in social_login.py and should work if the hyperlinks in /register match up.

iwein commented 10 years ago

We've got this fixed now. Will merge later today. Still working on the modals.