diff --git a/INSTALLATION.md b/INSTALLATION.md index b47d24cf..780328d8 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -1590,6 +1590,7 @@ define( 'CONSTANT_NAME', value ); | FICTIONEER_QUERY_RESULT_CACHE_THRESHOLD | integer | Count of a query result required to be eligible for caching. Default `50`. | FICTIONEER_QUERY_RESULT_CACHE_LIMIT | integer | Number of query results cached if the feature is enabled. Default `50`. | FICTIONEER_QUERY_RESULT_CACHE_BREAK | integer | Limit the number of large query result cache uploads per request. Default `3`. +| FICTIONEER_OAUTH_COOKIE_EXPIRATION | integer | Expiration time of the OAuth 2.0 login cookie in seconds. Default `259200` (3 days). | FICTIONEER_CACHE_PURGE_ASSIST | boolean | Whether to call the cache purge assist function on post updates. Default `true`. | FICTIONEER_RELATIONSHIP_PURGE_ASSIST | boolean | Whether to purge related post caches. Default `true`. | FICTIONEER_SHOW_SEARCH_IN_MENUS | boolean | Whether to show search page links in menus. Default `true`. diff --git a/functions.php b/functions.php index b70aa9b3..ff2dca0e 100644 --- a/functions.php +++ b/functions.php @@ -323,6 +323,11 @@ if ( ! defined( 'FICTIONEER_QUERY_RESULT_CACHE_BREAK' ) ) { define( 'FICTIONEER_QUERY_RESULT_CACHE_BREAK', 3 ); } +// Integer: OAuth login cookie lifetime +if ( ! defined( 'FICTIONEER_OAUTH_COOKIE_EXPIRATION' ) ) { + define( 'FICTIONEER_OAUTH_COOKIE_EXPIRATION', 3 * DAY_IN_SECONDS ); +} + /* * Booleans */ diff --git a/includes/functions/_module-oauth.php b/includes/functions/_module-oauth.php index 99641de3..3f34910f 100644 --- a/includes/functions/_module-oauth.php +++ b/includes/functions/_module-oauth.php @@ -472,7 +472,7 @@ function fictioneer_oauth2_make_user( $user_data, $cookie ) { // Allow login to last three days add_filter( 'auth_cookie_expiration', function( $length ) { - return 3 * DAY_IN_SECONDS; + return FICTIONEER_OAUTH_COOKIE_EXPIRATION; }); // Set authentication cookie