eve-sqlalchemy
eve-sqlalchemy copied to clipboard
some thing is missing in documents
I want to run Authentication example
code with python3, but not work
and raise Unicode-objects must be encoded before hashin
def encrypt(self, password):
"""Encrypt password using hashlib and current salt.
"""
return str(hashlib.sha1(password + str(self.salt))\
.hexdigest())
i think above code Should be changed to
def encrypt(self, password):
"""Encrypt password using hashlib and current salt.
"""
return str(hashlib.sha1((password + str(self.salt)).encode('utf8')).hexdigest())
btw, raise an AttributeError: 'User' object has no attribute 'salt'
When i use user.check_password(password)
in login method, because current obj has not salt
Oh well, these examples indeed have not been touched for a long time :). If you have a working solution by now, would me mind creating a PR with a new runnable example in the examples/
directory?
@dkellner of course