This commit is contained in:
James Cole 2020-11-07 17:19:23 +01:00
parent febcbac1de
commit 4fa92ed5f7
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
4 changed files with 13 additions and 1 deletions

View File

@ -198,6 +198,9 @@ class LoginController extends Controller
if ('remote_user_guard' === $authGuard && '' !== $logoutUri) {
return redirect($logoutUri);
}
if ('remote_user_guard' === $authGuard && '' === $logoutUri) {
session()->flash('error',trans('firefly.cant_logout_guard'));
}
$this->guard()->logout();

View File

@ -62,6 +62,13 @@ abstract class Controller extends BaseController
app('view')->share('DEMO_PASSWORD', config('firefly.demo_password'));
app('view')->share('FF_VERSION', config('firefly.version'));
// share custom auth guard info.
$authGuard = config('firefly.authentication_guard');
$logoutUri = config('firefly.custom_logout_uri');
app('view')->share('authGuard', $authGuard);
app('view')->share('logoutUri', $logoutUri);
// upload size
$maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize'));
$maxPostSize = app('steam')->phpBytes(ini_get('post_max_size'));

View File

@ -233,6 +233,7 @@ return [
'all_destination_accounts' => 'Destination accounts',
'all_source_accounts' => 'Source accounts',
'back_to_index' => 'Back to the index',
'cant_logout_guard' => 'Firefly III can\'t log you out.',
// check for updates:
'update_check_title' => 'Check for updates',

View File

@ -212,11 +212,12 @@
{% endif %}
</ul>
</li>
{% if 'remote_user_guard' != authGuard or '' != logoutUri %}
<li>
<a href="{{ route('logout') }}">
<i class="fa fa-sign-out fa-fw"></i>
<span>{{ 'logout'|_ }}</span>
</a>
</li>
{% endif %}
</ul>