haystack / YouPS

YouPS: An email automation tool that makes your email management easy! 😎
11 stars 5 forks source link

Enhanced login flow #189

Open soyapark opened 5 years ago

lukesmurray commented 5 years ago

Enhanced Login Flow

Updates from #191

Design Decisions

I added one url to http_handler/urls.py, r'^email_auth'. This url is attachhed to browser.views.authorize_email and renders browser/templates/youps/authorize_email.html.

The new url solely exists to authorize imap. The user must grant oauth or plain text password permissions.

I added two redirects to the editor. If the user is not logged in the editor redirects to the url name='auth_login'. If the user is logged in but does not have an imap account or their imap account is not authenticated then the editor redirects to name='email_auth'.

Because the user is always redirected to the correct place almost any code can now redirect to the editor and the user should end up in the correct place. The simplest example is the user clicking the YouPS logo.

Future Work

We should remove some of the old code for email authorization. The following url is deprecated along with its view. url(r'^login_imap', 'browser.views.login_imap'),

Any javascript code referencing btn_login or btn-login is now deprecated.

The <form id="login-email-form"> in browser/templates/youps/login_email.html is now deprecated.