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

Add .env properties for REMEMBER_ME_ENABLED and AUTO_LOGOUT_SECONDS

This commit is contained in:
Hillel Coren 2017-02-19 17:41:44 +02:00
parent 5704a2d955
commit d046a298e1
4 changed files with 18 additions and 3 deletions

View File

@ -54,6 +54,12 @@ FCM_API_TOKEN=
GOOGLE_MAPS_ENABLED=true GOOGLE_MAPS_ENABLED=true
#GOOGLE_MAPS_API_KEY= #GOOGLE_MAPS_API_KEY=
# Create a cookie to stay logged in
#REMEMBER_ME_ENABLED=true
# The app automatically logs the user out after this number of seconds
#AUTO_LOGOUT_SECONDS=28800
#S3_KEY= #S3_KEY=
#S3_SECRET= #S3_SECRET=
#S3_REGION= #S3_REGION=

View File

@ -86,6 +86,13 @@ If you need to set a list of trusted proxies you can add a TRUSTED_PROXIES value
TRUSTED_PROXIES='10.0.0.0/8,172.16.0.0/12,192.168.0.0/16' TRUSTED_PROXIES='10.0.0.0/8,172.16.0.0/12,192.168.0.0/16'
Stay logged in
""""""""""""""
By default the app clears the session when the browser is closed and automatically logs the user out after 8 hours.
This can be modified by setting ``REMEMBER_ME_ENABLED`` and ``AUTO_LOGOUT_SECONDS`` in the .env file.
Customizations Customizations
"""""""""""""" """"""""""""""

View File

@ -35,13 +35,15 @@
</div> </div>
@endif @endif
{{ Former::populateField('remember', 'true') }} @if (env('REMEMBER_ME_ENABLED'))
{{ Former::populateField('remember', 'true') }}
{!! Former::hidden('remember')->raw() !!}
@endif
<div> <div>
{!! Former::text('email')->placeholder(trans('texts.email_address'))->raw() !!} {!! Former::text('email')->placeholder(trans('texts.email_address'))->raw() !!}
{!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!} {!! Former::password('password')->placeholder(trans('texts.password'))->raw() !!}
</div> </div>
{!! Former::hidden('remember')->raw() !!}
{!! Button::success(trans('texts.login')) {!! Button::success(trans('texts.login'))
->withAttributes(['id' => 'loginButton', 'class' => 'green']) ->withAttributes(['id' => 'loginButton', 'class' => 'green'])

View File

@ -228,7 +228,7 @@
// auto-logout after 8 hours // auto-logout after 8 hours
window.setTimeout(function() { window.setTimeout(function() {
window.location = '{{ URL::to('/logout?reason=inactivity') }}'; window.location = '{{ URL::to('/logout?reason=inactivity') }}';
}, 1000 * 60 * 60 * 8); }, {{ 1000 * env('AUTO_LOGOUT_SECONDS', (60 * 60 * 8)) }});
// auto-hide status alerts // auto-hide status alerts
window.setTimeout(function() { window.setTimeout(function() {