mirror of
https://github.com/wassname/flask-security.git
synced 2026-06-27 16:10:11 +08:00
Add additional steps to the test_change_hash_type and make change to verify_and_update_password to make the test pass. Fixes #328.
This commit is contained in:
@@ -135,7 +135,7 @@ def verify_and_update_password(password, user):
|
||||
password = get_hmac(password)
|
||||
verified, new_password = _pwd_context.verify_and_update(password, user.password)
|
||||
if verified and new_password:
|
||||
user.password = new_password
|
||||
user.password = encrypt_password(password)
|
||||
_datastore.put(user)
|
||||
return verified
|
||||
|
||||
|
||||
@@ -171,6 +171,11 @@ def test_change_hash_type(app, sqlalchemy_datastore):
|
||||
response = client.post('/login', data=dict(email='matt@lp.com', password='password'))
|
||||
assert response.status_code == 302
|
||||
|
||||
response = client.get('/logout')
|
||||
|
||||
response = client.post('/login', data=dict(email='matt@lp.com', password='password'))
|
||||
assert response.status_code == 302
|
||||
|
||||
|
||||
def test_md5():
|
||||
data = md5(b'hello')
|
||||
|
||||
Reference in New Issue
Block a user