Skip to content

Commit

Permalink
refactor state setting
Browse files Browse the repository at this point in the history
  • Loading branch information
loganmcdonald-noaa committed May 7, 2024
1 parent 6e702d4 commit 1fea0b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
sso_login_path: '/saml/login'
sso_login_text: 'Login via SSO'
sso_cancel_path: '/'
sso_cancel_text: 'Cancel and return home'
sso_cancel_text: 'Cancel and return home'
7 changes: 2 additions & 5 deletions web/modules/weather_login/weather_login.module
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ function weather_login_form_user_login_form_alter(&$form, FormStateInterface $fo
$cancelText = $config->get('sso_cancel_text');

// Allow override for local login forms via $settings[] in settings.*.php
$settings_state = Settings::get('weather_login_local_form', 0);
if ($settings_state || $state) {
$state = 1;
}
$basicAuthSetting = Settings::get('weather_login_local_form', false);

if ($loginPath) {
if (!$state) {
if (!$basicAuthSetting) {
$form['name']['#access'] = false;
$form['pass']['#access'] = false;
$form['actions']['#access'] = false;
Expand Down

0 comments on commit 1fea0b7

Please sign in to comment.