mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Auto logout after inactivity
This commit is contained in:
parent
eb2e02a809
commit
6371339805
@ -186,6 +186,10 @@ class AuthController extends Controller
|
|||||||
|
|
||||||
Session::flush();
|
Session::flush();
|
||||||
|
|
||||||
|
if ($reason = request()->reason) {
|
||||||
|
Session::flash('warning', trans("texts.{$reason}_logout"));
|
||||||
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2344,6 +2344,8 @@ $LANG = array(
|
|||||||
'view_statement' => 'View Statement',
|
'view_statement' => 'View Statement',
|
||||||
'statement' => 'Statement',
|
'statement' => 'Statement',
|
||||||
'statement_date' => 'Statement Date',
|
'statement_date' => 'Statement Date',
|
||||||
|
'inactivity_logout' => 'Due to inactivity, you have been automatically logged out.',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return $LANG;
|
return $LANG;
|
||||||
|
@ -225,6 +225,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$(function() {
|
$(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() {
|
window.setTimeout(function() {
|
||||||
$(".alert-hide").fadeOut();
|
$(".alert-hide").fadeOut();
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user