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:
parent
eb2e02a809
commit
6371339805
@ -186,6 +186,10 @@ class AuthController extends Controller
|
||||
|
||||
Session::flush();
|
||||
|
||||
if ($reason = request()->reason) {
|
||||
Session::flash('warning', trans("texts.{$reason}_logout"));
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user