changed user token hash algorithm from sha1 to sha256 in API
parent
49a5d433c6
commit
7766723f60
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* ClockPicker v{package.version} (http://weareoutman.github.io/clockpicker/)
|
||||
* ClockPicker v0.0.7 (http://weareoutman.github.io/clockpicker/)
|
||||
* Copyright 2014 Wang Shenwei.
|
||||
* Licensed under MIT (https://github.com/weareoutman/clockpicker/blob/gh-pages/LICENSE)
|
||||
*/
|
||||
|
|
|
@ -431,7 +431,7 @@ class UserLogin:
|
|||
" (user_uuid, token, utc_expires) "
|
||||
" VALUES (%s, %s, %s) ")
|
||||
user_uuid = result['uuid']
|
||||
token = hashlib.sha1(os.urandom(24)).hexdigest()
|
||||
token = hashlib.sha512(os.urandom(24)).hexdigest()
|
||||
utc_expires = datetime.utcnow() + timedelta(seconds=60 * 60 * 8)
|
||||
cursor.execute(add_session, (user_uuid, token, utc_expires))
|
||||
cnx.commit()
|
||||
|
|
Loading…
Reference in New Issue