diff --git a/.env.example b/.env.example index 72f968b44096..1ed1ec049cbb 100644 --- a/.env.example +++ b/.env.example @@ -54,6 +54,12 @@ FCM_API_TOKEN= GOOGLE_MAPS_ENABLED=true #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_SECRET= #S3_REGION= diff --git a/docs/configure.rst b/docs/configure.rst index faad8578a85e..7c48478ebda1 100644 --- a/docs/configure.rst +++ b/docs/configure.rst @@ -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' +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 """""""""""""" diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 834087012483..6b48fadcaff1 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -35,13 +35,15 @@ @endif - {{ Former::populateField('remember', 'true') }} + @if (env('REMEMBER_ME_ENABLED')) + {{ Former::populateField('remember', 'true') }} + {!! Former::hidden('remember')->raw() !!} + @endif