Added user authentication check to timer

This commit is contained in:
Andrew Shumway
2023-09-08 13:51:12 -06:00
parent 1507199e6b
commit 92953676c4
2 changed files with 4 additions and 2 deletions

View File

@@ -5,7 +5,7 @@
const sessionTimer = document.getElementById("sessionTimer");
setTimeout(function() {
var timeTillSessionEnd = new Date().getTime() + (1 * 10 * 1000);
var timeTillSessionEnd = new Date().getTime() + (5 * 60 * 1000);
var x = setInterval(function() {
var now = new Date().getTime();
var difference = timeTillSessionEnd - now;
@@ -21,7 +21,7 @@
redirectToSignin();
}
}, 1000);
}, 1 * 20 * 1000);
}, 1 * 60 * 1000);
function redirectToSignin() {
window.location.href = '/sign-in';

View File

@@ -11,6 +11,7 @@
{% endblock %}
{% block head %}
{% if current_user.is_authenticated %}
{% block sessionUserWarning %}
<div class="usa-modal" id="sessionTimer" aria-labelledby="sessionTimerHeading" aria-describedby="timerWarning">
<div class="usa-modal__content">
@@ -53,6 +54,7 @@
<button class="usa-button" id="extendSessionTimer">Extend Session</button>
</dialog> -->
{% endblock %}
{% endif %}
{%- for font in font_paths %}
<link rel="preload" href="{{ asset_url(font, with_querystring_hash=False) }}" as="font" type="font/woff2" crossorigin>
{%- endfor %}