Skip to content

Commit

Permalink
Replaced env() with config() to check environment variables
Browse files Browse the repository at this point in the history
Made the app.php description for 'REQUIRE_SAML' a bit more... descriptive.
  • Loading branch information
adagioajanes committed Dec 16, 2021
1 parent a6116a1 commit 6898119
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,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)))
if(config('REQUIRE_SAML'))
{
return redirect()->route('saml.login');
}
Expand Down Expand Up @@ -209,7 +209,7 @@ 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)))
if(config('REQUIRE_SAML'))
{
return view('errors.403');
}
Expand Down
8 changes: 5 additions & 3 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,11 @@
| Require SAML Login
|--------------------------------------------------------------------------
|
| Disable the ability to login via form login, and require all logins to
| process via SAML login. (If you are not using SAML, this option should
| be left alone.)
| Disable the ability to login via form login, and disables the 'nosaml'
| workaround. It requires all logins to process via SAML login.
| (This is for high security setups. If your SAML configuration is not
| working, this option should be set to false. This option is not needed
| to successfully configure SAML authentication.)
|
*/

Expand Down

0 comments on commit 6898119

Please sign in to comment.