Skip to content

Commit

Permalink
If SAML required, don't accept login form post.
Browse files Browse the repository at this point in the history
  • Loading branch information
adagioajanes committed Dec 16, 2021
1 parent 696943b commit a6116a1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function showLoginForm(Request $request)
}

//If the environment is set to ALWAYS require SAML, go straight to the SAML route.
//We don't need to check other settings, as this should override those.
if((env("REQUIRE_SAML", false)))
{
return redirect()->route('saml.login');
Expand Down Expand Up @@ -207,6 +208,12 @@ private function loginViaRemoteUser(Request $request)
*/
public function login(Request $request)
{
//If the environment is set to ALWAYS require SAML, return access denied
if((env("REQUIRE_SAML", false)))
{
return view('errors.403');
}

if (Setting::getSettings()->login_common_disabled == '1') {
return view('errors.403');
}
Expand Down

0 comments on commit a6116a1

Please sign in to comment.