mirror of
https://github.com/wassname/flask-security.git
synced 2026-09-09 11:22:35 +08:00
Changing verify_password so it works like verify_and_update_password. Currently verify_password was not only creating a hmac hash but also encrypting (encrypt_password is first hmac-signing and then encrypting).
Removed unneccessary and wrong tests.
This commit is contained in:
@@ -20,6 +20,19 @@ from flask_security.signals import user_registered
|
||||
from tests import SecurityTest
|
||||
|
||||
|
||||
class PasswordVerifyEncryptTests(SecurityTest):
|
||||
|
||||
AUTH_CONFIG = {
|
||||
'SECURITY_PASSWORD_HASH': 'bcrypt',
|
||||
'SECURITY_PASSWORD_SALT': '89gf828uiguiu23ju2'
|
||||
}
|
||||
|
||||
def test_verify_password_bcrypt(self):
|
||||
from flask_security.utils import verify_password, encrypt_password
|
||||
with self.app.app_context():
|
||||
self.assertTrue(verify_password('custompassword', encrypt_password('custompassword')))
|
||||
|
||||
|
||||
class ConfiguredPasswordHashSecurityTests(SecurityTest):
|
||||
|
||||
AUTH_CONFIG = {
|
||||
|
||||
Reference in New Issue
Block a user