mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-27 16:10:11 +08:00
Update CHANGES and a little polish
This commit is contained in:
@@ -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
|
||||
-------------
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user