Plugin Directory

Changeset 1954575


Ignore:
Timestamp:
10/10/2018 01:49:31 PM (7 years ago)
Author:
nmallare
Message:

Update to use add_filter to configure JWT token expiration.

Location:
divvyhq/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • divvyhq/trunk/README.txt

    r1866628 r1954575  
    55Tested up to: 4.9.5
    66Requires PHP: 5.2.4
    7 Stable tag: 1.0.2
     7Stable tag: 1.0.3
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4040== Changelog ==
    4141
     42= 1.0.3 =
     43Use add_filter to configure JWT token expiration.
     44
    4245= 1.0.2 =
    4346Set JWT Secret Key to WP constant and configure .htaccess.
  • divvyhq/trunk/admin/class-divvyhq-admin.php

    r1866628 r1954575  
    226226        }
    227227    }
     228
     229    /**
     230     * This function will set the JWT token to expire one year from
     231     * creation. The JWT default is only seven days.
     232     *
     233     * @param $issuedAt
     234     * @return integer
     235     */
     236    public function divvyhq_jwt_auth_expire()
     237    {
     238        return time() + (DAY_IN_SECONDS * 365);
     239    }
    228240}
  • divvyhq/trunk/divvyhq.php

    r1866628 r1954575  
    1616 * Plugin URI:        https://www.wordpress.com/
    1717 * Description:       This plugin allows users to sync their content from their WordPress instance back to DivvyHQ.
    18  * Version:           1.0.2
     18 * Version:           1.0.3
    1919 * Author:            Alluresoft, LLC
    2020 * Author URI:        https://www.divvyhq.com/
     
    3838 * Current plugin version.
    3939 */
    40 define('DIVVYHQ_VERSION', '1.0.2');
     40define('DIVVYHQ_VERSION', '1.0.3');
    4141
    4242
     
    4646if (!defined('JWT_AUTH_SECRET_KEY') && defined('SECURE_AUTH_SALT')) {
    4747    define('JWT_AUTH_SECRET_KEY', SECURE_AUTH_SALT);
    48 }
    49 
    50 /**
    51  * Set timeout for JWT Auth Token
    52  */
    53 if (!defined('JWT_AUTH_EXPIRE')) {
    54     define('JWT_AUTH_EXPIRE', time() + (DAY_IN_SECONDS * 90));
    5548}
    5649
  • divvyhq/trunk/includes/class-divvyhq.php

    r1866628 r1954575  
    5959            $this->version = DIVVYHQ_VERSION;
    6060        } else {
    61             $this->version = '1.0.2';
     61            $this->version = '1.0.3';
    6262        }
    6363
     
    139139        $plugin_admin = new DivvyHQ_Admin($this->get_plugin_name(), $this->get_version());
    140140
     141        // Set the token expiration to one year.
     142        $this->loader->add_filter('jwt_auth_expire', $plugin_admin, 'divvyhq_jwt_auth_expire');
     143
    141144        // WP admin settings
    142145        $this->loader->add_action('admin_menu', $plugin_admin, 'add_divvyhq_admin_menu');
Note: See TracChangeset for help on using the changeset viewer.