django-session-security
django-session-security copied to clipboard
Added seconds countdown if "counterElementID" is set
This adds a counter to count down the number of seconds remaining until expiration if counterElementID is set, e.g.:
<h3>{% trans 'Your session is about to expire in' %} <span id="in_seconds"></span> {% trans 'seconds' %}</h3>
<script type="text/javascript">
var sessionSecurity = new yourlabs.SessionSecurity({
pingUrl: '{% url 'session_security_ping' %}',
warnAfter: {{ request|warn_after|unlocalize }},
expireAfter: {{ request|expire_after|unlocalize }},
confirmFormDiscard: "{% trans 'You have unsaved changes in a form of this page.' %}",
counterElementID: "in_seconds"
});
</script>
This would be very helpful. Please merge.
I love it! @jpic , what do you think?
Working great, enabled by default, except made sure we don't introduce a new translatable string, merged manually