Skip to content

Commit

Permalink
Merge pull request #19 from CU-CommunityApps/cache-fix
Browse files Browse the repository at this point in the history
Caching fix: turn off caching on user login form
  • Loading branch information
judaw authored Apr 18, 2024
2 parents 0d3734d + 32d21b6 commit b0446e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cwd_saml_mapping.module
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ function cwd_saml_mapping_preprocess_item_list(&$variables) {
function cwd_saml_mapping_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
if ($form_id == 'user_login_form') {
$config = \Drupal::config('cwd_saml_mapping.config_form');

$form['#cache'] = ['max-age' => 0];

$hide_drupal_login_prod = $config->getRawData()['hide_drupal_login_prod'] ?? false;
$is_prod_and_hide = (isset($_ENV['PANTHEON_ENVIRONMENT']) && $_ENV['PANTHEON_ENVIRONMENT'] === 'live' && $hide_drupal_login_prod);
$hide_drupal_login = $config->getRawData()['hide_drupal_login'] ?? false;
Expand Down

0 comments on commit b0446e6

Please sign in to comment.