Closed menno-ll closed 8 months ago
I've added another PR https://github.com/oidc-wp/openid-connect-generic/pull/514 that actually sets the WP user cookie expiration time to the token expiration time of the IDP.
This PR unit test does not succeed because of a connection error, not because the test itself is failing. I however don't have the ability to re-run the unit test without making a change, which seems kind of useless. If you could please restart it, that would be great. Thanks!
All Submissions:
Changes proposed in this Pull Request:
Closes #512 .
This change allows the user to, using a filter, login users via the rememberme option in WordPress. The wordpress login cookies will then be set for 14 days by default instead of two days as a session.
I originally wanted to use the token expiration date to do so, however this doesn't seem possible as you cannot pass an expiration date to the wp_set_auth_cookie function. So instead I chose to implement the remember me feature as used by WordPress itself.
What could maybe be possible is to dynamically add a filter for auth_cookie_expiration, so the WP user cookie expiration can be set to the same value. This filter needs to be added temporarily, and then removed. However this is kind of hacky and i think it would be better to submit that as a separate PR after this one is approved.
How to test the changes in this Pull Request:
add_filter( 'openid-connect-generic-remember-me', '__return_true' );
to the functions.php file.Other information:
Changelog entry