mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 22:19:41 -08:00
Merge pull request #10998 from johnson-yi/fixes/saml_logout
Fixes #10980 - Prevent immediate saml login after normal logout
This commit is contained in:
commit
313150e6dd
|
@ -68,15 +68,17 @@ class LoginController extends Controller
|
||||||
return redirect()->intended('/');
|
return redirect()->intended('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the environment is set to ALWAYS require SAML, go straight to the SAML route.
|
if (!$request->session()->has('loggedout')) {
|
||||||
// We don't need to check other settings, as this should override those.
|
// If the environment is set to ALWAYS require SAML, go straight to the SAML route.
|
||||||
if (config('app.require_saml')) {
|
// We don't need to check other settings, as this should override those.
|
||||||
return redirect()->route('saml.login');
|
if (config('app.require_saml')) {
|
||||||
}
|
return redirect()->route('saml.login');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($this->saml->isEnabled() && Setting::getSettings()->saml_forcelogin == '1' && ! ($request->has('nosaml') || $request->session()->has('error'))) {
|
if ($this->saml->isEnabled() && Setting::getSettings()->saml_forcelogin == '1' && ! ($request->has('nosaml') || $request->session()->has('error'))) {
|
||||||
return redirect()->route('saml.login');
|
return redirect()->route('saml.login');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Setting::getSettings()->login_common_disabled == '1') {
|
if (Setting::getSettings()->login_common_disabled == '1') {
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
<!-- Notifications -->
|
<!-- Notifications -->
|
||||||
@include('notifications')
|
@include('notifications')
|
||||||
|
|
||||||
|
@if (!config('app.require_saml'))
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<!-- CSRF Token -->
|
<!-- CSRF Token -->
|
||||||
|
|
||||||
|
@ -59,10 +60,10 @@
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div> <!-- end col-md-12 -->
|
</div> <!-- end col-md-12 -->
|
||||||
|
@endif
|
||||||
</div> <!-- end row -->
|
</div> <!-- end row -->
|
||||||
|
|
||||||
@if ($snipeSettings->saml_enabled)
|
@if (!config('app.require_saml') && $snipeSettings->saml_enabled)
|
||||||
<div class="row ">
|
<div class="row ">
|
||||||
<div class="text-right col-md-12">
|
<div class="text-right col-md-12">
|
||||||
<a href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a>
|
<a href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a>
|
||||||
|
@ -71,12 +72,16 @@
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
|
@if (config('app.require_saml'))
|
||||||
|
<a class="btn btn-lg btn-primary btn-block" href="{{ route('saml.login') }}">{{ trans('auth/general.saml_login') }}</a>
|
||||||
|
@else
|
||||||
<button class="btn btn-lg btn-primary btn-block">{{ trans('auth/general.login') }}</button>
|
<button class="btn btn-lg btn-primary btn-block">{{ trans('auth/general.login') }}</button>
|
||||||
|
@endif
|
||||||
</div>
|
</div>
|
||||||
<div class="text-right col-md-12 col-sm-12 col-xs-12" style="padding-top: 10px;">
|
<div class="text-right col-md-12 col-sm-12 col-xs-12" style="padding-top: 10px;">
|
||||||
@if ($snipeSettings->custom_forgot_pass_url)
|
@if ($snipeSettings->custom_forgot_pass_url)
|
||||||
<a href="{{ $snipeSettings->custom_forgot_pass_url }}" rel="noopener">{{ trans('auth/general.forgot_password') }}</a>
|
<a href="{{ $snipeSettings->custom_forgot_pass_url }}" rel="noopener">{{ trans('auth/general.forgot_password') }}</a>
|
||||||
@else
|
@elseif (!config('app.require_saml'))
|
||||||
<a href="{{ route('password.request') }}">{{ trans('auth/general.forgot_password') }}</a>
|
<a href="{{ route('password.request') }}">{{ trans('auth/general.forgot_password') }}</a>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue