1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Auto logout after inactivity

This commit is contained in:
Hillel Coren 2017-01-31 13:09:25 +02:00
parent eb2e02a809
commit 6371339805
3 changed files with 12 additions and 0 deletions

View File

@ -186,6 +186,10 @@ class AuthController extends Controller
Session::flush();
if ($reason = request()->reason) {
Session::flash('warning', trans("texts.{$reason}_logout"));
}
return $response;
}
}

View File

@ -2344,6 +2344,8 @@ $LANG = array(
'view_statement' => 'View Statement',
'statement' => 'Statement',
'statement_date' => 'Statement Date',
'inactivity_logout' => 'Due to inactivity, you have been automatically logged out.',
);
return $LANG;

View File

@ -225,6 +225,12 @@
}
$(function() {
// auto-logout after 8 hours
window.setTimeout(function() {
window.location = '{{ URL::to('/logout?reason=inactivity') }}';
}, 1000 * 60 * 60 * 8);
// auto-hide status alerts
window.setTimeout(function() {
$(".alert-hide").fadeOut();
}, 3000);