Problem/Motivation
When updating from CAS 2.x to 3.x, the new js_cookie dependency is not installed. If installing CAS 3.x from the start, js_cookie is installed as expected. I noticed when installing a new site from an install profile that it was failing because js_cookie was not in core.extension.yml.
Steps to reproduce
1. Install a new Drupal 10 site
2. composer require 'drupal/cas:^2.3'
3. drush en cas -y
4. composer require 'drupal/cas:^3.0@beta'
5. drush updb -y
6. Verify that js_cookie is not enabled
Proposed resolution
Add a post_update hook that installs js_cookie if CAS has gateway auth enabled and is configured to use the client side redirect.
Update the CAS config form to prevent users from enabling gateway auth with client side redirect if the module is not already installed (add a form validation error?)
Update our JS for client side auth to confirm that the Cookie library is available. If not, just back out and do nothing. This will prevent JS errors.
Remove JS cookie as a module dependency in the .info.yml file
Issue fork cas-3528901
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
bkosborneYea this was missed.
We have only one feature that uses this, which is the client-side authentication method for gateway authentication. I imagine most sites don't use this, so we should consider not installing the module for everyone.
Updated the proposed resolution...
Comment #4
bkosborneComment #5
dimitriskr commentedIs it a better idea to move this functionality into a submodule?
* (functionality === client-side authentication method for gateway authentication) so that js_cookie can be set as a clear dependency?
Comment #6
bkosborneMaybe! It may be a bit tricky to pull the logic out of the main module.
Comment #8
bkosborne