Add FICTIONEER_OAUTH_COOKIE_EXPIRATION constant

This commit is contained in:
Tetrakern 2024-11-16 14:06:59 +01:00
parent 04624569fe
commit 17d21c61fb
3 changed files with 7 additions and 1 deletions

View File

@ -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_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_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_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_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_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`. | FICTIONEER_SHOW_SEARCH_IN_MENUS | boolean | Whether to show search page links in menus. Default `true`.

View File

@ -323,6 +323,11 @@ if ( ! defined( 'FICTIONEER_QUERY_RESULT_CACHE_BREAK' ) ) {
define( 'FICTIONEER_QUERY_RESULT_CACHE_BREAK', 3 ); 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 * Booleans
*/ */

View File

@ -472,7 +472,7 @@ function fictioneer_oauth2_make_user( $user_data, $cookie ) {
// Allow login to last three days // Allow login to last three days
add_filter( 'auth_cookie_expiration', function( $length ) { add_filter( 'auth_cookie_expiration', function( $length ) {
return 3 * DAY_IN_SECONDS; return FICTIONEER_OAUTH_COOKIE_EXPIRATION;
}); });
// Set authentication cookie // Set authentication cookie