Add option to environment to require SAML for a more secure installation.

This commit is contained in:
Alex Janes
2021-12-16 11:44:07 -05:00
parent 52322806fa
commit 3c8d70c5fb
2 changed files with 18 additions and 1 deletions
@@ -74,6 +74,12 @@ class LoginController extends Controller
return redirect()->intended('/');
}
//If the environment is set to ALWAYS require SAML, go straight to the SAML route.
if((env("REQUIRE_SAML", false)))
{
return redirect()->route('saml.login');
}
if ($this->saml->isEnabled() && Setting::getSettings()->saml_forcelogin == '1' && ! ($request->has('nosaml') || $request->session()->has('error'))) {
return redirect()->route('saml.login');
}