On 05/16/2015 03:49 PM, Andrew Shadura wrote:
# HG changeset patch
# User Andrew Shadura <[email protected]>
# Date 1431709586 -7200
#      Fri May 15 19:06:26 2015 +0200
# Node ID 93de511e84fe940786acf468789a77daed83a461
# Parent  95bffe63997d40bfab5ae6b8d1a54859d6275471
auth: let users log in using their email address

diff --git a/kallithea/controllers/login.py b/kallithea/controllers/login.py
--- a/kallithea/controllers/login.py
+++ b/kallithea/controllers/login.py
@@ -121,9 +121,15 @@ class LoginController(BaseController):
                  session.invalidate()
                  c.form_result = login_form.to_python(dict(request.POST))
                  # form checks for username/password, now we're authenticated
+
+                username = c.form_result['username']
+                if '@' in username:
+                    username = User.get_by_email(username).username

This will still fail if the username not is a valid email address?

/Mads


_______________________________________________
kallithea-general mailing list
[email protected]
http://lists.sfconservancy.org/mailman/listinfo/kallithea-general

Reply via email to