mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-19 22:58:30 +00:00
change the session timeout to be configurable
This commit is contained in:
parent
199a307cd9
commit
97163b7cb0
@ -121,8 +121,10 @@ class Auth(JSONComponent):
|
|||||||
m.update(str(random.getrandbits(40)))
|
m.update(str(random.getrandbits(40)))
|
||||||
m.update(m.hexdigest())
|
m.update(m.hexdigest())
|
||||||
session_id = m.hexdigest()
|
session_id = m.hexdigest()
|
||||||
|
|
||||||
|
config = component.get("DelugeWeb").config
|
||||||
|
|
||||||
expires = int(time.time()) + 3600
|
expires = int(time.time()) + config["session_timeout"]
|
||||||
expires_str = time.strftime('%a, %d %b %Y %H:%M:%S UTC',
|
expires_str = time.strftime('%a, %d %b %Y %H:%M:%S UTC',
|
||||||
time.gmtime(expires))
|
time.gmtime(expires))
|
||||||
|
|
||||||
@ -298,4 +300,4 @@ class Auth(JSONComponent):
|
|||||||
log.debug("Failed to detect the login method")
|
log.debug("Failed to detect the login method")
|
||||||
d.callback(False)
|
d.callback(False)
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
@ -85,6 +85,7 @@ CONFIG_DEFAULTS = {
|
|||||||
"pwd_salt": "c26ab3bbd8b137f99cd83c2c1c0963bcc1a35cad",
|
"pwd_salt": "c26ab3bbd8b137f99cd83c2c1c0963bcc1a35cad",
|
||||||
"pwd_sha1": "2ce1a410bcdcc53064129b6d950f2e9fee4edc1e",
|
"pwd_sha1": "2ce1a410bcdcc53064129b6d950f2e9fee4edc1e",
|
||||||
"base": "",
|
"base": "",
|
||||||
|
"session_timeout": 3600,
|
||||||
"sessions": {},
|
"sessions": {},
|
||||||
"sidebar_show_zero": False,
|
"sidebar_show_zero": False,
|
||||||
"sidebar_show_trackers": False,
|
"sidebar_show_trackers": False,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user