diff options
author | gumi <git@gumi.ca> | 2020-03-06 16:29:51 -0500 |
---|---|---|
committer | gumi <git@gumi.ca> | 2020-03-06 16:29:51 -0500 |
commit | f7eeeccb0811887449149b46cf0592c30b9919a2 (patch) | |
tree | 0ca840981e98978d08a2fa61f7d9568bc516dd2e | |
parent | 86be43f1c0143495abe003654a4e415a154b11d4 (diff) | |
download | apiv1-f7eeeccb0811887449149b46cf0592c30b9919a2.tar.gz apiv1-f7eeeccb0811887449149b46cf0592c30b9919a2.tar.bz2 apiv1-f7eeeccb0811887449149b46cf0592c30b9919a2.tar.xz apiv1-f7eeeccb0811887449149b46cf0592c30b9919a2.zip |
only give 30 minutes to click a login link
-rw-r--r-- | src/routers/vault/utils/ephemeral.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/routers/vault/utils/ephemeral.js b/src/routers/vault/utils/ephemeral.js index 211e84b..570600c 100644 --- a/src/routers/vault/utils/ephemeral.js +++ b/src/routers/vault/utils/ephemeral.js @@ -11,13 +11,17 @@ const session_handler = { if (obj === null || obj === undefined) return obj; - if (Reflect.has(obj, timeout_symbol)) + let minutes = 30; + + if (Reflect.has(obj, timeout_symbol)) { clearTimeout(obj[timeout_symbol]); + minutes = 360; // 6 hours + } let expires = new Date(); - expires.setUTCHours(expires.getUTCHours() + 6); + expires.setUTCMinutes(expires.getUTCMinutes() + minutes); obj.expires = expires // this could also be a symbol - obj[timeout_symbol] = setTimeout(() => session_handler.delete(key), 6 * 3600000); // 6 hours + obj[timeout_symbol] = setTimeout(() => session_handler.delete(key), minutes * 60000); return obj; }, |