Update CHANGES and a little polish

This commit is contained in:
Matt Wright
2013-04-04 10:23:51 -04:00
parent 1108f1670c
commit e8b0c62818
2 changed files with 12 additions and 3 deletions
+8
View File
@@ -3,6 +3,14 @@ Flask-Security Changelog
Here you can see the full list of changes between each Flask-Security release.
Version 1.6.2
-------------
Released April 4th 2013
- Fixed bug with http basic auth
Version 1.6.1
-------------
+4 -3
View File
@@ -9,6 +9,7 @@
:license: MIT, see LICENSE for more details.
"""
from collections import namedtuple
from functools import wraps
from flask import current_app, Response, request, redirect, _request_ctx_stack
@@ -30,6 +31,8 @@ _default_unauthorized_html = """
or your browser doesn't understand how to supply the credentials required.</p>
"""
BasicAuth = namedtuple('BasicAuth', 'username, password')
def _get_unauthorized_response(text=None, headers=None):
text = text or _default_unauthorized_html
@@ -67,9 +70,7 @@ def _check_token():
def _check_http_auth():
from collections import namedtuple
Auth = namedtuple('Auth', 'username, password')
auth = request.authorization or Auth(username=None, password=None)
auth = request.authorization or BasicAuth(username=None, password=None)
user = _security.datastore.find_user(email=auth.username)
if user and utils.verify_and_update_password(auth.password, user):