Add FICTIONEER_OAUTH_COOKIE_EXPIRATION constant
This commit is contained in:
parent
04624569fe
commit
17d21c61fb
@ -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`.
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user